Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
i am using below code for upload file into my Uploads file.it is working fine when i use in my local machine.
once i deployed my application in IIS, the file uploaded but with 0 KB and unable to open. any help regarding this


C#
string filename = System.IO.Path.GetFileName(FileUpload.FileName);
FileUpload.SaveAs(Server.MapPath("~/Uploads/") + filename);
Posted

1 solution

Your code is OK but may be your iis configuration have some problem. Check your upload folder that have write permission or not? Check your IIS settings that how much large file can upload. Hope your problem will be solved.
 
Share this answer
 
Comments
Nick Fisher (Consultant) 28-Jan-14 10:22am    
Yes, it sounds likely to be a flle permission problem. Put a try/catch statement around your code to see what exception it throws. Also, make sure the disk is not full on the IIS server!

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