Click here to Skip to main content
15,919,749 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guyz!!!

In my application I want to extract whole path of file uploaded using FileUpload server control.
My web app. will be running only on localhost.
I tried many things to extract full path of uploaded file,but in vain!!!

And i only need uploaded file's path,i dont want to upload that file.

If you know any other way to do so ,please help me!!!

Thanx alot!!!:D

You can't do it.

Security concerns will not allow the server to be aware of the file and / or network structure of the client via the FileUpload control, just the file name.
Share this answer
Sergey Alexandrovich Kryukov 8-May-11 11:29am    
...And I cannot see why it should be needed. This is user's concern, totally private; only the content of the file matters.
My 5.
abhijeetgupta1988 9-May-11 8:20am    
Thanx for your reply!!! ;)
I forgot to mention that,my web app. will run on local host much like desktop app.
URL of file uploaded will be used to open in respective application.
eg.If i upload an Excel file from "D:/ABC/acc.xl" then i will be able to open that file in MS-Excel when i click on the link of that file from web browser itself.

Sounds weird but it's my requirement!!!

Any other alternatives can be suggested!!!

OriginalGriff 9-May-11 8:26am    
Doesn't make any difference: if you use an upload control, you only get access to the filename.

If you provide a link to a file in the browser, then it can be downloaded and edited automatically.
If it is a local server, U can try fileUpload.PostedFile.FileName this will help.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900