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
I recently upgraded my project which was in RN0.38.0 to RN 0.40.0 using react-native-git-upgrade.
The project includes ImagePickerIOS to open gallery and select an image, which is sent to the back end.
Iam sending the file as FormData to the backend.
Everything is working good in RN0.38.0, but the server returns file not found when using RN0.40.0
i.e. In the backend file received is undefined.
IMPORTANT : When I log the API call, the multipart form data is being sent.
What did i do wrong here??
Reproduction
This is the FormData code I use :
var body = new FormData();
var photo = {
uri : uri,
type: 'image/jpeg',
name: 'profilePic'+ new Date().getTime() +'.jpg',
};
body.append('file',photo);
Additional Information
React Native version: 0.40.0
Platform: iOS
Operating System: MacOS
The text was updated successfully, but these errors were encountered:
Mmm, that code should work. Can you get a form working in a basic app that doesn't have other stuff? I suspect the problem is somewhere else in your stack than the code you pasted.
Description
I recently upgraded my project which was in RN0.38.0 to RN 0.40.0 using react-native-git-upgrade.
The project includes ImagePickerIOS to open gallery and select an image, which is sent to the back end.
Iam sending the file as FormData to the backend.
Everything is working good in RN0.38.0, but the server returns file not found when using RN0.40.0
i.e. In the backend file received is undefined.
IMPORTANT : When I log the API call, the multipart form data is being sent.
What did i do wrong here??
Reproduction
This is the FormData code I use :
var body = new FormData();
var photo = {
uri : uri,
type: 'image/jpeg',
name: 'profilePic'+ new Date().getTime() +'.jpg',
};
body.append('file',photo);
Additional Information
The text was updated successfully, but these errors were encountered: