Solved

How Do You Use the Tag <asp:FileUpload /> to go to the Direct Path to Retrieve the File?

Posted on 2013-12-05
2
314 Views
Last Modified: 2013-12-06
I am trying to load a file using the ASP.NET tag <asp:FileUpload ID="BulkDataFileUpload" runat="server" />.  However, it is not retrieving the full path of the file name I am selecting.  It is only retrieving the file name.  I have to hard code the path to the file name.

My usage:
Dim file As String = "C:\BulkUploadFiles\" + BulkDataFileUpload.FileName

How do you use this tag without hard coding the file path?

Thanks,

Dan
0
Comment
Question by:danielolorenz
2 Comments
 
LVL 27

Accepted Solution

by:
Chinmay Patel earned 250 total points
ID: 39699052
This is a server side tag and it will only get you the filename. What exactly you want to do with complete path? you want to check on server side from which folder user uploaded the file?

Or you just want to save the file? If you want to save the file then you can either hard code the path as you have done OR you can use Server.MapPath("~/Files/") + BulkDataFileUpload.FileName.
0
 
LVL 75

Assisted Solution

by:käµfm³d 👽
käµfm³d   👽 earned 250 total points
ID: 39700215
Only non-standardized browsers (e.g. early versions of IE) will provide you with the full path of a file on a client's machine. It is generally perceived as a security risk to divulge the full path of where a folder resides on a client's machine.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question