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

iOS: uploaded image bigger than the original #260

Closed
riccardonucleare opened this issue May 7, 2021 · 2 comments
Closed

iOS: uploaded image bigger than the original #260

riccardonucleare opened this issue May 7, 2021 · 2 comments

Comments

@riccardonucleare
Copy link

Hi,
We are experiencing an issue when uploading an image JPG with iOS with apollo-upload-client.
The image is taken from the gallery (original size is around 2.4 MB) and we compress it to around 500 kB. We upload it to server with a mutation where we use graphql-upload with middleware graphqlUploadExpress using ReactNativeFile. However, when we check the image on S3, the image is 2 MB. We tried with several images and the result is similar: uploaded image is bigger than the compressed one.
We tried to upload the image without the middleware using a plain POST request and in this case, the image was uploaded with the expected size (500 kB).
Interesting that we do not have the same problem with Android using the same code. Any suggestion for debugging it?

cf. jaydenseric/graphql-upload#82

@jaydenseric
Copy link
Owner

Closing because the apollo-upload-client approach uses standard web platform APIs like File, FormData and fetch so I don't think your issues could relate to this particular package. Of course, if you end up finding the source of the problem and it's a bug here we can reopen.

@riccardonucleare
Copy link
Author

I found the problem and solved with this: facebook/react-native#31457

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants