Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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 20-Feb-13 22:06pm
Comments
OriginalGriff at 21-Feb-13 3:14am
   
Show the whole method you are using to save the file - the click event handler.
Richard MacCutchan at 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)



Advertise | Privacy | Mobile
Web03 | 2.8.150129.1 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100