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
316 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

705 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