Uploading mp4 on iOS to express / node server fails

Hey there,

Building off this thread: https://forums.expo.dev/t/uploading-videos-to-server/19046; I’ve had the same issue where uploading .mov files works fine on iOS, but uploading .mp4 files fails because the server side only recognizes it as a jpeg and that clashes with me calling it a video, etc… etc…

I’m using fetch with Content-Type set to multipart/form-data, and the .mp4 file is coming from the iOS media library (so it’s an asset-library://… file). Using Expo SDK 31, which is on RN 0.57, and testing on an iPhone 7 running 12.1.4 (latest). Server side it’s a standard node / express app, which is parsing the file using express-multer (based on busboy).

Googled this issue like crazy and all I can find is maybe the fetch protocol is somehow messed up in RN when it comes to mp4s on iOS, but can’t seem to fix it with anything I try. Any help would be much appreciated; happy to provide more info.


1 Like

Hello? Anyone?

hi! this sounds like an issue with your server… if you can provide a end to end reproducible example (a github repo would be helpful) and ideally demonstrate that this is indeed an issue with expo (and not your backend) we’d be happy to help. additionally, when you said you googled it like crazy could you share the things you tried that didn’t work? https://medium.com/react-native-training/uploading-videos-from-react-native-c79f520b9ae1 for example seems like exactly what you’re looking for

Hi @notbrent ,

Finally had the chance to put an end to end reproducible repo together: https://github.com/ilya-section4/testfileupload.

The thing to test specifically is when you’re uploading an mp4 video from the iOS media library (gallery), does it get properly uploaded to AWS? What I’m getting is the mp4 video is being recognized with the mimetype: ‘image/jpeg’ and is not being fully uploaded. I’m not sure how to show whether this is specific to Expo, to React Native or to the backend… iOS device captured videos (in MOV format) are being uploaded just fine.

Could you please take a look and let me know if you also experience this issue?