asp:FileUpload seems to give me the filename but not the complete path.

A

AAaron123

<asp:FileUpload> seems to give me the filename but not the complete path.

I'm guessing that it a security thing and I can't get it.

Is that correct?



Thanks
 
A

AAaron123

AAaron123 said:
<asp:FileUpload> seems to give me the filename but not the complete
path.

I'm guessing that it a security thing and I can't get it.

Is that correct?



Thanks

Looks like IE8 remove the path.

I was just listing it any way.
 
P

Patrice

Hi,
Looks like IE8 remove the path.

Correct and the edit box should be read only.

See
http://blogs.msdn.com/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
and the "File Upload Control" section :

"Additionally, the "Include local directory path when uploading files"
URLAction has been set to "Disable" for the Internet Zone. This change
prevents leakage of potentially sensitive local file-system information to
the Internet. For instance, rather than submitting the full path
C:\users\ericlaw\documents\secret\image.png, Internet Explorer 8 will now
submit only the filename image.png."
 
A

AAaron123

Patrice said:
Hi,


Correct and the edit box should be read only.

See
http://blogs.msdn.com/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
and the "File Upload Control" section :

"Additionally, the "Include local directory path when uploading files"
URLAction has been set to "Disable" for the Internet Zone. This change
prevents leakage of potentially sensitive local file-system
information to the Internet. For instance, rather than submitting the
full path C:\users\ericlaw\documents\secret\image.png, Internet
Explorer 8 will now submit only the filename image.png."

As an aside:
You can copy it with javascript on the onclientclick event into something,
but you get someting like:

C:/fakefolder/filename.txt

Cute

I only listed it as info because the controls text box gets cleared after
the upload.
Got a supprise when it stoped working.

Thanks
 
Joined
Sep 17, 2009
Messages
4
Reaction score
0
hi,

string filePath=FileUpload1.PostedFile.FileName;
string fileName = FileUpload1.FileName;

filePath is the path of the File, while fileName is the file name.


Comm100
_______________
Free chat software for you
Microsoft Certified Partner
.comm100.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top