Click here to Skip to main content
15,894,337 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am unable to save file on server in root directory folder while the code is working fine on localhost. The code is as below
C#
SavePath = Server.MapPath("~/uploads/Excel/") + System.DateTime.Now.Ticks.ToString() + FileUpload1.FileName;
FileUpload1.SaveAs(SavePath);
hidFile.Value = SavePath;

any suggestions are appreciated....
Posted
Updated 8-Apr-11 0:25am
v3

What exception do you receive? Have you seen this post[^]? Maybe the answer is right there!

Good luck!
Eduard
 
Share this answer
 
I think the folder permission is not set. go to that folder (where you want to upload your file)
properties->security and allow it to read and write.
i think your code will run properly.
 
Share this answer
 
v2
Hope this link will help you.

http://support.microsoft.com/kb/323246[^]
 
Share this answer
 
v2
The code is fine. Check the folder permission.
 
Share this answer
 

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