Click here to Skip to main content
14,835,688 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Like if i want to upload a file using browse.but after select the file we want local system path in browser ,Example : Local System Path may be "C:/UserName/Download/ABC.txt".

What I have tried:

Like if i want to upload a file using browse.but after select the file we want local system path in browser ,Example : Local System Path may be "C:/UserName/Download/ABC.txt".
Posted
Updated 4-Jul-17 1:19am

You can't get this information for security reasons, and it's of no real value to you anyway.
   
Comments
manigupta9044 4-Jul-17 6:53am
   
Thanks,that's i know but is there anyway using third party tool or something ?
F-ES Sitecore 4-Jul-17 7:11am
   
No, if there was a way of getting around it it wouldn't be a very good security feature.
You can't get it at all: except in conditions which hardly occur at all these days: your user must be running IE, he must accept ActiveX controls, and he must permit ActiveX controls to run. Hardly anyone runs IE, and the other two are disabled by default for security reasons (because ActiveX controls can access the client filesystem and that caused a load of problems with malicious code).

"Standard" JavaScript cannot access the host file system and that includes paths - and indeed the host may not even have a path-based file system, it could be an internet enabled fridge, or a toaster for example!
All you can access is the filename, and file content: and the use must specify the file.

Think about it: if you could do it, so could malicious sites. And we have enough problems with ransomware these days - can you imagine the damage if you just needed to visit a site and it could access your file system?
   

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