Click here to Skip to main content
12,746,945 members (33,135 online)
Rate this:
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?


Posted 20-Feb-13 22:06pm
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)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170215.1 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2017
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