Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It seems you're expecting the File System API to work locally similar to an OS file system. The client doesn't work like that. In fact, and API is designed to be your interface, as a programmer, to the files and directories -- the client itself (e.g., Chrome, etc.) will handle the rest on the local level. The API is not designed by which you can create a file via the browser and easily access it via the operating system.</p> <p><strong>How can I know where Javascript really wrote this file? In what "root" (since the 'root' cannot be assigned)?</strong></p> <p>Technically speaking, each client can store locally as it chooses. So while you can go to the local file system to look for the file, something is wrong with your approach if you're attempting to do so; the File System API is not meant for that. To your question, you can assume that if there's content the client's storage area (e.g., for Chrome it's something like "C:\Users\USERNAME\AppData\Local\Google\Chrome\User Data\Default\File System\") then you can assume that the JavaScript wrote it. But again, it's not set up for user friendly browsing on the local system.</p> <p><strong>What does it mean that the FileSystem is a 'sandbox'?</strong></p> <p>Sandbox simply means an area created and set aside for a specific purpose, outside of which the client cannot see/access. See this from Mozilla: <a href="https://developer.mozilla.org/en-US/docs/WebGuide/API/File_System/Introduction#virtual" rel="nofollow">https://developer.mozilla.org/en-US/docs/WebGuide/API/File_System/Introduction#virtual</a></p> <p><strong>That I cannot access the (virtual?) contents of it on my local drive, but only with JS?</strong></p> <p>That is correct, and by design.</p> <p><strong>If this is the case, is there a way to prompt the user to save the file?</strong></p> <p>If I understand your question right, you're asking if there is a way to provide a specific file to the user and have it prompt them to save it locally. Well, of course if you provide a link to the file (or push it, a different discussion) then the client will prompt the user to save/store it if their platform allows them to do so. But you have no control over where they save it locally nor can you later get it it. If I've misunderstood your question, comment below and I'll follow up.</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.
 

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