-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Filesystem improvements #974
Comments
👍 Using |
Hello, are there any plans to implement any of the improvements suggested above? |
@jcesarmobile is there any progress with saving as a blob? If not, what would you recommend is the best approach to store blob data? |
Would be a good one to look at after 1.0 to improve filesystem performance, along with #1392 and #1391 |
Also feeling pretty limited without |
Sharing my workaround with you. I'm using web-implementation of the Filesystem plugin.
|
Any news on blob support? |
If anyone still needs this, I implemented a solution myself which works with current cap version. Here is a sample app: https://github.com/digaus/CapacitorSaveBlob Tested myself in browser, android and on iOS. Maybe @jcesarmobile or someone else is willing to integrate this into the current filesystem plugin (maybe add a new encoding type blob) if this solution is up to their standard 😄 Edit: with this PR it will also work for electron -> #2567 |
Any update on this in version 3? |
Capacitor V3Trying to safe Fetched PDF file. But when i open the file it outputs blank page Preview: pdfOut.pdf My Code:
Here is result of
|
It would be really useful specially because there is an issue wthin the FileReader which in this case can be used to convert a Blob to a base64 to be written using current Filesystem.writeFile. The issue consists in not firing the onloadend, onload etc... on FileReader instance when using Capacitor. The thread: FileReader API not firing metions a workaround which is working fine for converting Blob to base64, then saving with Filesystem. I'm watching this thread now looking forward to replace the current workaround with a final solution, hopefully saving the Blob instance directly. Thanks ! |
Any update? |
Hi, a cannot comment on the mentioned issue anymore, so i will comment here so the next guys wont stuck anymore :) -> If in web (for development) get normal FileReader instance private run() {
const response = await fetch(path);
const blob = await response.blob();
const reader = this.getFileReader();
reader.onload = (): void => {
console.log(reader.result)
this.changeDetectorRef.detectChanges();
};
reader.readAsDataURL(blob);
}
private getFileReader(): FileReader {
if (!Capacitor.isNativePlatform()) {
return new FileReader();
}
const fileReader = new FileReader() as any;
const reader = fileReader._realReader;
return reader;
} |
The FileWriteOptions
directory
property needs to accept string concatenations likeFilesystemDirectory.ExternalStorage + '/downlad'
, not only types defined in Enum.Will be useful If the The FileWriteOptions
directory
acceptsBlob
type not only strings.When you write a file, if it already exists, it will be overwritten? Is there any parameter for this?
The text was updated successfully, but these errors were encountered: