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
315 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 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