Find the path to the file to be downloaded

I would like to know the paths of certain files that the user is going to upload using my form. I know this is not allowed using JavaScript for privacy reasons, but the system I am building is internal to staff. Maybe there is a JavaScript certificate or something I can put on our servers to say that I can do this? Just like Flash permits a policy file.

I had a quick google and couldn't find anything like the above. What are my options? I mean, how can I get the file paths to download soon, I'll take any implementation idea to get over this. If I can't seem to find a solution, then what I'm trying to build is nice and really buggered !

I thought about asking users to download a text file containing these paths, but this is not very convenient.

Thanks everyone

+2


source to share


5 answers


You can get the path to be loaded just fine, but you cannot change it ...



var fil = document.getElementById("FileUpload1");
alert(fil.value); // will show file name

      

+2


source


Why not open an OpenDialog window? This works well with IE, which you can dictate as you work internally.



<html>
<head>
<script>
function attachFile(){
  document.forms[0]['file'].click();
  document.getElementById("FileOP").innerHTML += "<br />"+document.forms[0]['file'].value;
  return;
}
</script>
</head>
<body>
<form style="margin: 0px; padding: 0px;">
<input type="file" name="file" style="display: none" />
</form>

<a href="javascript:attachFile()">Attach File</a>
<br />
<div id="FileOP">
</div>
</body>
</html>

      

+1


source


Perhaps you can with a browser extension. You overcome many of the limitations of XUL in Firefox

0


source


If you're open to browser extensions, you can see if Google Gears can . It is available for most browsers and platforms.

0


source


JavaScript was developed for this very reason. This prevents remote systems from tracking the user. Otherwise a serious security issue.

If you really need to see the local filesystem, you will have to use Java.

-2


source







All Articles