Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all experts,

I'm using fileupload1 to select files i want to upload server.
Before upload to server, I need to display list of files that i selected.
In that list, it has col like Source Path,FileName,Size...
ex: I selected file from C:\New Folder\test1.txt
so in that list will be display
C:\New Folder is source Path
test1 is Filename


Does anybody know how i can get source path of selected file?

Thanks

TONY
Posted

1 solution

Fileupload has a property named FileName which gives the selected file path.

Refer this - http://msdn.microsoft.com/en-us/library/aa479405.aspx[^]
 
Share this answer
 
Comments
soeun tony 22-Oct-13 23:45pm    
Hi Ranjan,
Property FileName just get the name of selected file only. it doesn't get the path of selected file.
Ranjan.D 22-Oct-13 23:51pm    
I hope FileUpload1.PostedFile.FileName should work.

Please have a look into - http://forums.asp.net/t/1333198.aspx
JoCodes 23-Oct-13 1:13am    
FileUpload1.PostedFile.FileName also will return Filename without the full path. ( even System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName) the same.)

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