ASP. NET get client upload file Full path method:
Eg:f:\test\1.doc
Based on browser security issues, the browser will mask the way to get the full path of the client file, only get the file name of the file, if you need to get the full path, you need another way
Two ways are available:
Method 1: Use the Internet Options, security-and custom level, tools, find " include local directory paths when uploading local files to the server " in "Other", and select "Enable".
Method 2:
function GetPath () {//get the file control object varobj = document.getElementById ("UploadFile"); if(obj) {if(Window.navigator.userAgent.indexOf ("MSIE") >=1) {obj.Select(); returnDocument.selection.createRange (). text; } Else if(Window.navigator.userAgent.indexOf ("Firefox") >=1) { if(obj.files) {returnObj.files.item (0). Getasdataurl (); } returnObj.value; } returnObj.value; } }