Click here to Skip to main content
15,900,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when user upload file by FileUpload at online website, so how can save image at online folder.


C#
string filename = Path.GetFileName(FileUpload1.FileName);
             FileUpload1.SaveAs(Server.MapPath("/fileupload/" + FileUpload1.FileName ));
             lblmsg.Text = "Upload status: File uploaded!";
Posted
Comments
DINESH K MAURYA 20-Jun-12 3:34am    
clarify the online folder,
if user upload any file it should be uploaded fileuploadfolder
Pratham4950 20-Jun-12 4:07am    
yes, i want this but not save and some error occurred.

Using File upload control the best way is to save all the pictures in a folder

1. that is configured as a virtual directory in IIS.
2. A sub-folder inside your website folder.
3. A folder on which the IIS and the current user with which website is running has access to. You will have to ask you admin to do that.
4. A folder on a clustered storage.
 
Share this answer
 
Comments
Pratham4950 29-Jun-12 12:15pm    
thx,
User should have write access on the folder, where you are trying to upload.
 
Share this answer
 
Comments
Pratham4950 20-Jun-12 4:27am    
how can i access on the folder ? because my folder is online.
Pratham4950 29-Jun-12 11:54am    
thx, for your ans. it's working.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900