Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form Data not sent in RN0.40.0 #12295

Closed
Suresh-R-S opened this issue Feb 9, 2017 · 4 comments
Closed

Form Data not sent in RN0.40.0 #12295

Suresh-R-S opened this issue Feb 9, 2017 · 4 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@Suresh-R-S
Copy link

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

  • React Native version: 0.40.0
  • Platform: iOS
  • Operating System: MacOS
@lacker
Copy link
Contributor

lacker commented Feb 10, 2017

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.

@digin-project
Copy link

Any feedback on this ? I think we have the same issue here and we are kind of stuck with our iOS version since we upgraded RN to 0.40.0

@pariswang
Copy link

same issue on 0.42.3.
any feedback?

@hramos
Copy link
Contributor

hramos commented Aug 24, 2017

Closing due to lack of response from the author.

@hramos hramos closed this as completed Aug 24, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Aug 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Aug 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

6 participants