Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi i am using fileupload tag to upload the file. what is does it saves the file into the follwoing directory: C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\
can somebody tells me how to change this path and save the upload file into some other directory.
Posted
Comments
CodingLover 28-Oct-11 8:01am    
Can you show us that how did you upload the file?
saifullahiit 28-Oct-11 8:44am    
FileUpload1.PostedFile.SaveAs(Server.MapPath("~\\NewFolder1\\") + FileUpload1.FileName);

1 solution

You have complete control of this. If you want to the file saved to a different path, then tell it

C#
fileUpload.PostedFile.SaveAs("c:\my path\" + fileUpload.FileName);


Just make sure the folder has permissions
 
Share this answer
 
v2
Comments
saifullahiit 28-Oct-11 8:44am    
FileUpload1.PostedFile.SaveAs(Server.MapPath("~\\NewFolder1\\") + FileUpload1.FileName);

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