Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET4.0
Hi Friends ,
 
i am using file upload control in my project but i failed to get full path of file so anybody help me to solve this problem.
eg. required path F:\somedirectory\sub\filename.extention
Thank You.
Posted 13-Feb-12 2:44am
Edited 13-Feb-12 2:47am
v2
Comments
manognya kota at 13-Feb-12 7:46am
   
could you please post your code what you have tried?
Rajesh Anuhya at 13-Feb-12 7:47am
   
Edited.
--RA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Comments
B Birajdar at 13-Feb-12 8:52am
   
excellent info in the link....
My 5
Rajesh Anuhya at 13-Feb-12 8:57am
   
Thanks
--RA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

try
 
Server.MapPath(FileUpload1.FileName);
 
Hope it helps.
  Permalink  
Comments
mail02nilesh at 13-Feb-12 7:53am
   
it gives root path and i want hard drive path
Syed Salman Raza Zaidi at 13-Feb-12 8:05am
   
try this Path.GetFullPath(FileUpload1.FileName)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

When you are working with the FileUpload control , you dont need the full path of the file where the file comes from.
 
Instead on the click of "Submit" or "Upload" button, you just need to check the FileUpload1.HasFile property and then save the file to the server on any path using
 
FileUpload1.SaveAs(pathOnServer");
 
The FullPath is not displayed as a security measure to avoid exposing the client's machine's folder structure or drives to the server.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 George Jonsson 215
1 Kornfeld Eliyahu Peter 169
2 Zoltán Zörgő 139
3 PIEBALDconsult 130
4 OriginalGriff 120
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,342


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 22 Oct 2012
Copyright © CodeProject, 1999-2014
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