You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@diachedelic: First just want to say thanks for the plugin. It's been a core feature in the app we are building. I do have a question for you and leaving it here in the hopes others may want the same info. In our app we are trying to support large files around 150 MBs and writing those to the device. We pull the file stream from our server and then grab the response data via response.blob(). When we go to write the file to device sometimes it succeeds and other times it fails. I also sometimes see the error mentioned in #9 but not sure that is related. My question is: Is there a recommended way to have more consistent file writes to device when the files exceed 100 MB in size.
Also, is there a way to get the progress of a file write? So that for large files we could display / track the progress to the users?
The text was updated successfully, but these errors were encountered:
AdlerJS
changed the title
Question: Best Practice for Writing Large Files
Question: Best Practice for Writing Large Files / Progress Indicator
Apr 1, 2022
The write_blob function uses fetch to transmit the blob to a local HTTP server, which writes the request body to disk. As of Chrome 95, fetch can take a stream as the body parameter, finally making it possible to monitor the progress of an HTTP request. So yes, it is theoretically possible to have a progress indicator in some browsers.
Regarding stability, it would probably be possible to modify write_blob to accept a stream instead of a Blob, which could help if it was a memory issue. But I am doubtful, because I think browsers automatically purge Blobs to disk when they get large enough to exhaust available memory. Another strategy could be to write the file in, say, 50MB chunks. See #22.
If you can find out why it sometimes fails that would be very helpful. Does it fail on Android, iOS or both?
@diachedelic - Sorry for the late reply. After spending more time researching the plugin its actually very optimized and wasn't the cause of our issues. Our issues were caused by inconsistent networks to actually get the blob from the server. Once the file was downloaded to the client blob-writer was very fast in writing files around 100 MB to device and very consistent. Closing this issue based on the findings
@diachedelic: First just want to say thanks for the plugin. It's been a core feature in the app we are building. I do have a question for you and leaving it here in the hopes others may want the same info. In our app we are trying to support large files around 150 MBs and writing those to the device. We pull the file stream from our server and then grab the response data via
response.blob()
. When we go to write the file to device sometimes it succeeds and other times it fails. I also sometimes see the error mentioned in #9 but not sure that is related. My question is: Is there a recommended way to have more consistent file writes to device when the files exceed 100 MB in size.Also, is there a way to get the progress of a file write? So that for large files we could display / track the progress to the users?
I'll provide a code sample below:
The text was updated successfully, but these errors were encountered: