Thread: file upload
View Single Post
Join Date: Dec 2008
Posts: 37
Reputation: kischi is an unknown quantity at this point 
Solved Threads: 0
kischi kischi is offline Offline
Light Poster

Re: file upload

 
0
  #8
Dec 30th, 2008
The autentication was allready set to Windows.

//use System.Web.UI.HtmlControls.HtmlInputFile >> filSelectFile
string nameOfFile = filSelectFile.Value;//Get selected file
//Get actual file name
int last = nameOfFile.LastIndexOf("\\");
nameOfFile = nameOfFile.Substring(last + 1);
//Saving location
//this must be virtual folder of your web server
string uploadFolder = ConfigurationSettings.AppSettings["FileUploadFolder"];
nameOfFile = uploadFolder +"\\" + nameOfFile;
//Upload the file
filSelectFile.PostedFile.SaveAs(nameOfFile);
Where would I put this into the code. Or is this the only code that should be on the page instead of my other code?

Thanks
Last edited by kischi; Dec 30th, 2008 at 3:50 pm.
Reply With Quote