Solved

Select a file and get the file path without uploading

Posted on 2014-11-05
1
178 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 32

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

10 Experts available now in Live!

Get 1:1 Help Now