Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If the user selects a file via <code>&lt;input type="file"&gt;</code>, you can <a href="https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications" rel="noreferrer">read</a> and <a href="http://www.html5rocks.com/en/tutorials/file/dndfiles/" rel="noreferrer">process</a> that file using the <a href="https://www.w3.org/TR/FileAPI/" rel="noreferrer">File API</a>.</p> <p>Reading or writing arbitrary files is not allowed by design. It's a violation of the sandbox. From <a href="http://en.wikipedia.org/wiki/JavaScript#Security" rel="noreferrer">Wikipedia -> Javascript -> Security</a>:</p> <blockquote> <p>JavaScript and the DOM provide the potential for malicious authors to deliver scripts to run on a client computer via the web. Browser authors contain this risk using two restrictions. First, scripts run in a sandbox in which they can only perform web-related actions, not general-purpose programming tasks like <strong>creating files</strong>.</p> </blockquote> <p><strong>2016 UPDATE</strong>: Accessing the filesystem directly is possible via the <a href="https://developer.mozilla.org/en-US/docs/Web/API/File_System_API" rel="noreferrer">Filesystem API</a>, which is <a href="http://caniuse.com/#feat=filesystem" rel="noreferrer">only supported by Chrome and Opera</a> and <a href="http://www.html5rocks.com/en/tutorials/file/filesystem/" rel="noreferrer">may end up not being implemented by other browsers</a> (with the <a href="https://developer.microsoft.com/en-us/microsoft-edge/platform/status/filewriter/" rel="noreferrer">exception of Edge</a>). For details see <a href="https://stackoverflow.com/questions/371875/local-file-access-with-javascript/38254151#38254151">Kevin's answer</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload