1

Possible Duplicate:
how to resolve the C:\fakepath?

Can I get full path of an uploaded file using JavaScript? I tried asyncfileuploder but I am getting file name only. How to get full path using JavaScript? Also, how can I get full path with different methods?

<ContentTemplate>
 <cc1:AsyncFileUpload runat="server" ID="uploadExcelFle" UploaderStyle="Modern"
     ThrobberID="imgLoader" OnClientUploadStarted="uploadClientStarted"/>
 </ContentTemplate>

function uploadClientStarted(sender, args) {
 var fileName = args.get_fileName();
 var fileExt = fileName.substring(fileName.lastIndexOf(".") + 1);
 var filePath = args.get_path();
}
Community
  • 1
  • 1
fresher
  • 21
  • 1
  • 4

1 Answers1

0

You won't be able to get it that would be a large security risk. Here's what msdn says:

Source:
MSDN SRC1
MSDN SRC2

One more thing is that the path is only relative to the client computer and once the file is uploaded to the server it is no longer relevant. You can't depend on knowing the file structure of the client machine, as it may change without you knowing, which would then break your code.

Subhankar
  • 126
  • 6