Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all experts,
I try to upload my file to server. but all files uploaded become 0 byte and can't open.
the above is my source code to upload by using FileUpload Control.
String FileName="D:\DOCUMENTS\MYCV.doc";
cmdupload.PostedFile.SaveAs(Server.MapPath("~/Files/") + FileName);
After uploaded, i checked my file again and the size of this is 0 byte and i can't open this file too.

Does anybody know about this?

Thanks

TONY
Posted
Comments
OriginalGriff 21-Feb-13 3:14am    
Show the whole method you are using to save the file - the click event handler.
Richard MacCutchan 21-Feb-13 5:43am    
You have include the drive letter and root directory in your filename; that will lead to an invalid path on the 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