Click here to Skip to main content
15,916,417 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need the actual location of the file that i have just uploaded via a file upload control in asp.net. i've tried using

string fileName = Path.GetFullPath(fUpldGetDoc.PostedFile.FileName);

but this returns

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\angel from montegomery.txt


but i need the actual location of the file i.e,
e:\angel from montegomery.txt
Posted
Updated 12-Oct-11 1:39am
v3

You can do by a javascript

http://forums.asp.net/t/1077850.aspx/1[^]


few other methods are also discussed and hope useful
 
Share this answer
 
using System.io;

C#
FileInfo f = New FileInfo(Server.MapPath(".") + "\" + uploadedfilename);

       String fileName = f.FullName;
 
Share this answer
 
C#
string fileName = fUpldGetDoc.PostedFile.FileName;


try this
 
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