i want to retrieve the path of file being uploaded by FileUpload control. i have tried FileIpload1.FileName and FileUpload1.PostedFile.FileName but both of these statements return only file name and not the path (in mozilla firefox).
Thanx
i want to retrieve the path of file being uploaded by FileUpload control. i have tried FileIpload1.FileName and FileUpload1.PostedFile.FileName but both of these statements return only file name and not the path (in mozilla firefox).
Thanx
Since the FileUpload is a server-side control, it does not have any property that returns complete file name and file path. To get the file path from the browser, you'll have to use javascript. Here's an example:
<form id="Form1" action="" method="post">
<input type="file" />
<input type="button" onclick="alert(this.previousSibling.value);"
value="select file and press the button" />
However, browsers never reveal the original path of the file from the client side - not even to JavaScript. So all you might get is: C:\fakepath\ + your file name