HTML and CSS Reference
In-Depth Information
Importing files from the user's computer is a little more complicated than creating an empty
file. You need to create a FileEntry and then write the contents of the imported file to the
FileEntry using the File Writer API.
File Writer API
13.0
N/A
N/A
N/A
N/A
In addition, because you added the multiple attribute to the File Browser Import form,
...< form name = "import" >
< div >
< h2 > Import existing file ( s )</ h2 >
<input type= "file" name= "files" multiple accept= "text/html" >
< input type = "submit" value = "Import" >
</ div >...
you must handle the possibility of importing multiple files at one time. Although imple-
menting this isn't difficult, the validation process becomes more complicated, as you'll see.
Copy the following code, and insert it right after the event listener you added to the create
form in the previous section.
Listing 3.15. app.js—Importing files from the user's computer
Search WWH ::




Custom Search