使用文件系统API将本地驱动器上的文件上传到本地文件系统的HTML中

WBOY
WBOY 转载
2023-08-24 18:13:06 520浏览

使用文件系统API将本地驱动器上的文件上传到本地文件系统的HTML中

  • 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

    上面,err和fs是−

    var fs,
    err = function(err) {
       throw err;
    };

    以上就是使用文件系统API将本地驱动器上的文件上传到本地文件系统的HTML中的详细内容,更多请关注php中文网其它相关文章!

    声明:本文转载于:tutorialspoint,如有侵犯,请联系admin@php.cn删除