Select directory for HTML5 multiple file input in Firefox?

后端 未结 2 1571
鱼传尺愫
鱼传尺愫 2021-01-02 05:49

I want to allow users to select a local directory on a webpage (and then read all the files in the directory).

In Chrome I can add the webkitdirectory a

相关标签:
2条回答
  • 2021-01-02 06:03

    Firefox doesn't have any API to upload directories yet (which is a shame)...not even in the nightly builds, so I don't think we will see support on this very soon. IE doesn't have one either. If you want to take advantage of this feature you must force the users to use Google Chrome (e.g. make them aware that upload directory is available only in Chrome).

    A workaround would be to compress the directory in a .zip file and read it with the FileReader API. See https://stackoverflow.com/a/7842896/613453

    Update
    IE Edge now has support for this.
    https://msdn.microsoft.com/en-us/library/mt574730(v=vs.85).aspx

    0 讨论(0)
  • 2021-01-02 06:21

    Now you can upload directory using drag and drop with chrome

    read this article you will get more info

    http://updates.html5rocks.com/2012/07/Drag-and-drop-a-folder-onto-Chrome-now-available

    0 讨论(0)
提交回复
热议问题