Tìm các tệp cục bộ bằng API Hệ thống tệp

Nếu có đối tượng File (chẳng hạn như một đối tượng được lưu trữ bằng FileSystem API), thì bạn có thể tìm và đọc các phần mà không cần đọc toàn bộ tệp vào bộ nhớ:

var url = "filesystem:http://example.com/temporary/myfile.zip";

window.webkitResolveLocalFileSystemURL(url, function(fileEntry) {
    fileEntry.file(function(file) {
    var reader = new FileReader();

    reader.onload = function(e) {
        var ab = e.target.result; // arrayBuffer containing bytes 0-10 of file.
        var uInt8Arr = new Uint8Array(ab);
        ...
    };

    var blob = file.webkitSlice(0, 10, "application/zip");  // mimetype is optional
    reader.readAsArrayBuffer(blob);
    }, errorHandler);
}, errorHandler);