Splitting a file into chunks and uploading

Is there a way to split files into chunks and upload them to a server (via something like axios)? Seems like there is no Blob support in Expo at this time, so not sure if there is another way to do this without detaching. Perhaps I’m missing something? Another workaround would be to split the file into smaller files and upload them that way, but I don’t see a way to do this using the FileSystem api. The chunks need to be uploaded as binary data.

Hey @davidbarese,

Blob support was introduced back in SDK26! Uploading Images to Firebase with Expo | by William Candillon | Medium You may want to double check the code, but I think most of it should have remained the same.


@adamjnav thanks for the quick reply. I see the blob support but I was still having trouble trying to upload them. I was getting unrecognized format errors in the formData, but when I use a file object, it works nicely. After looking into this more, I was able to use the FileSystem api by reading the original file data in chunks (using the position and length options), then saving them as temporary files by writing in base64. Then I uploaded each “chunk” file using the file object and works nicely :grinning:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.