Capture path in fileupload control
I have a web application which creates an email with attachments. I use the fileUpload control to browse to the file, but I need to capture the contents of the field to the left of the browse button, the field with the drive, path and filename. I have looked at the fileUpload control and can get the FileUpload.PostedFile.Filename but I need the drive and path also. Any help/suggestions much appreciated. Thanks. Don
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

CrishRank #1,487 · 1.1K reputationPosted Mar 28, 2011, 9:20 AM EDT
Suthish NairRank #92 · 22.8K reputationPosted Mar 28, 2011, 9:40 AM EDT
use..
System.IO.Path.GetDirectoryName(Server.MapPath(FileUpload1.PostedFile.FileName));