Local file access with JavaScript

前端 未结 13 2551
悲哀的现实
悲哀的现实 2020-11-21 04:07

Is there local file manipulation that\'s been done with JavaScript? I\'m looking for a solution that can be accomplished with no install footprint like requiring Adobe AIR.<

13条回答
  •  旧巷少年郎
    2020-11-21 04:59

    Just an update of the HTML5 features is in http://www.html5rocks.com/en/tutorials/file/dndfiles/. This excellent article will explain in detail the local file access in JavaScript. Summary from the mentioned article:

    The specification provides several interfaces for accessing files from a 'local' filesystem:

    1. File - an individual file; provides readonly information such as name, file size, MIME type, and a reference to the file handle.
    2. FileList - an array-like sequence of File objects. (Think or dragging a directory of files from the desktop).
    3. Blob - Allows for slicing a file into byte ranges.

    See Paul D. Waite's comment below.

提交回复
热议问题