Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File System Access #11346

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions extensions/web/09_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,17 @@
return new BlobReference(id, data.byteLength);
}

/**
* Create a new blob part from a file path.
*
* @param {string} path
* @returns {BlobReference}
*/
static fromPath(path) {
const id = core.opSync("op_blob_create_file_part", path);
return new BlobReference(id, data.byteLength);
}

/**
* Create a new BlobReference by slicing this BlobReference. This is a copy
* free operation - the sliced reference will still reference the original
Expand Down Expand Up @@ -531,6 +542,7 @@
}

window.__bootstrap.file = {
BlobReference,
getParts,
Blob,
File,
Expand Down
Loading