Skip to content
Advertisement

React Native Image Upload File Extension Error

I am trying to upload an image to Django backend server with React Native.

JavaScript

but I got an error that says File Extension "" is not allowed. Allowed extension are... and there is no problem with the data I sent.

JavaScript

After some research I found out that a lot of people faced with this problem when using react-native-image-crop-picker but they get network error however I don’t have a problem with sending the data. So I don’t think this problem caused by Flipper

P.S: this is the backend code if needed:

JavaScript

Advertisement

Answer

After thousands of tries, I found out that changing name: "img" to name: "img.jpg fixed the issue.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement