Click here to Skip to main content
15,913,238 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all experts,
My client has one 1 file in "D:\Document\Files\my Report.doc"
i want to get the path of this file and insert to one list. but i don't know how to do this. i try to user fileupload1.filename,PostedFile.FileName,Server.MapPath(fileupload1.FileName),
Server.MapPath("~/") + cmdupload.FileName. But they all are wrong.
coz they just get only file name ("My report.doc").

The reason that i want to get the path of this file because this file will not upload to web server but it will upload to other database server attachment file (SAP Attachment file).

Does anybody know how i can get the full of this file ("D:\Document\Files") by using fileupload?

Thanks

TONY
Posted
Comments
Sergey Alexandrovich Kryukov 16-Feb-13 0:56am    
Full path on client or server side?
—SA

1 solution

To get the filename only
C#
fileupload1.FileName

To get the filename with complete selected path
C#
fileupload1.PostedFile.FileName
 
Share this answer
 
v2
Comments
soeun tony 17-Feb-13 21:07pm    
Hi Bandi-Ramesh,
I try to use fileupload1.filename and fileupload1.postedfile.filename already
but it returns me the file name only.

Thanks

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