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
311 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 74

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now