- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Upload from local drive to local filesystem in HTML with Filesystem API
To upload from local drive to the local file system, we can use −
- Webkitdirectory attribute on <input type=”file”> − This allows the user to select a directory by the appropriate dialog box.
- Filesystem API is a sandboxed filesystem, which allows us to store files on client’s machine.
- File API allows us to read files. Files are accessible by <input type=”file”> element
All of the above is working fine in Google Chrome.
WebKit directory is a much better option among these. Use the following for directory −
webkitRequestFileSystem( window.TEMPORARY, 5 * 1024 * 1024, function(_fs) { fs = _fs; }, Err
Above, err and fs are −
var fs, err = function(err) { throw err; };
Advertisements