Does HTML5 allow you to interact with local client files from within a browser

后端 未结 3 1561
半阙折子戏
半阙折子戏 2020-11-27 18:55

I\'ve seen some posts regarding access to files on a client machine by a webpage, namely this question.

I\'m trying to hop on the \"continuously update in the cloud

3条回答
  •  迷失自我
    2020-11-27 19:36

    No, not directly at least. However, you have a number of choices here.

    Currently your best choices are:

    • Drag and drop files from desktop, see a tutorial. (Link disabled for malware/phishing)
    • Use input type file.
      • Read the contents with the File API or submit the form. Read more on Mozilla Developer Center about reading the file dynamically.
      • You can specify multiple attribute to read and open multiple files at once without having to have separate fields.
      • You can have an invisible input and "trigger a click" on it to open the file open dialog. See the previous Mozilla Developer Center link for details.
    • Use the FileSystem API which allows you to create, delete, read, modify files on the file system. Note: you get a sandboxed directory to work with, you can't access the whole system just like that.
    • Use Java with signed applets to access the whole file system. This requires the user to accept the signature.

提交回复
热议问题