Solved

Select a file and get the file path without uploading

Posted on 2014-11-05
1
182 Views
Last Modified: 2014-11-06
Hi,

I would like to be able to just browse and choose a file from my computer and get the file and path into that selection. I don't want to upload it, I just want the user to be able to choose the file from his/her system so that I can get hold of the path and file in code behind. In that way I can move the file internally on the network.

I can't use an upload control for security reasons (it will only give me the file name) so I winder if anyone has some insight on another way to do this.

Thanks for help!

Peter
0
Comment
Question by:peternordberg
1 Comment
 
LVL 33

Accepted Solution

by:
ste5an earned 500 total points
ID: 40425744
As it's ASP.NET, you want that the user browses for a file in the browser. Then sends the path to your server. Now you(?) - maybe you mean the ASP.NET application - should move the file?

If your answers are yes, then my answer is: this is not possible.

For two reasons:

The path transmitted to your server is the path as seen by the client. Even worse, it may be a local mapped path. Imho there is no way to use a Windows API function like WNetGetUniversalName (advapi32) in the browser. And you cannot rely on normal netlogon scripts to get the mappings right, this is only possible in a highly restriced and controlled environment.

The user has under most circumstances different permissions than your ASP pool thread. So you cannot access the files from your application.

Especially the permission problem should make you rethink what you're trying to do. Maybe you can give us a little bit more context.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

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…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

770 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