Closed Mat-thieu closed 7 months ago
The FileSystemWritableFileStreamTarget
expects a FileSystemWritableFileStream
as a parameter! Its write
method also accepts ArrayBuffers as input.
It seems like you are passing it something else. How are you getting your fileWriter
?
@Vanilagy
Aah right, I see! Indeed I'm passing a different object. I'm passing it a FileWriter
which is returned from a fileEntry.createWriter directly.
I'm obtaining this fileEntry from the following code
export default function requestTempFile(name, sizeInMb) {
return new Promise((resolve) => {
const fileSystem = (window.requestFileSystem || window.webkitRequestFileSystem);
fileSystem(window.TEMPORARY, sizeInMb * 1024 * 1024, (fs) => {
fs.root.getFile(name, { create: true }, (fileEntry) => {
resolve(fileEntry);
});
});
});
}
Which is a non-standard, chromium-specific way of creating a sandboxed file.
It's a slightly different use case, it can likely just be handled by the StreamTarget directly
Yes exactly, these custom cases are supposed to be handled by StreamTarget
. It'll be very easy and quick to use! In fact, FileSystemWritableFileStreamTarget
is nothing but a very thin wrapper around StreamTarget
.
Has your issue been resolved?
I'll close this issue for now as it seems stale, so I assume your issue has been resolved. If you still need help with something, feel free to reopen it :)
The following error:
Occurs when trying to use
FileSystemWritableFileStreamTarget
with fileWriter.This write function (in the build code) is expecting a blob not an object
For now I've worked around the issue by wrapping the fileWriter