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

Upload multiple image issue #1264

Closed
HardikKardani opened this issue Jun 18, 2020 · 7 comments
Closed

Upload multiple image issue #1264

HardikKardani opened this issue Jun 18, 2020 · 7 comments
Milestone

Comments

@HardikKardani
Copy link

Hello

I am trying to upload user profile picture and cover photo using below code..

issue:- every time i am getting json formate error and status code 400. but if i only upload single photo and other image as nill then it works fine.

if let imageData = imgProfilePicture.image!.jpegData(compressionQuality: 0.7){
            let fileFieldName   = "pic"
            let file            = GraphQLFile(fieldName: fileFieldName, originalName: "fileFieldName.jpg", mimeType: "image/jpg", data: imageData)
            
            let imageCoverData = imgCoverPhoto.image!.jpegData(compressionQuality: 0.7)
            let coverPhotoFieldName   = "coverPhoto"
            let coverPhotoFile            = GraphQLFile(fieldName: coverPhotoFieldName, originalName: "coverPhoto.jpg", mimeType: "image/jpg", data: imageCoverData!)
            
            Network.shared.apollo.upload(operation: UpdateUserMutation(email:"[email protected]", pic: "0", coverPhoto: "1"), files: [file, coverPhotoFile])
}

is there any issue in passing data or what?

@designatednerd
Copy link
Contributor

I think this may be related to #1081 - I'm going to try to land that by the end of this week but for now I think the best workaround is to upload one photo at a time.

@HardikKardani
Copy link
Author

@designatednerd thank you for quick update.

@HardikKardani
Copy link
Author

@designatednerd is there any update ?

@designatednerd
Copy link
Contributor

Was not able to get this done last week and then have been having some technical difficulties this week, but it's still on my list to land that PR!

@designatednerd
Copy link
Contributor

Please see #1279 for what should be a solution to this.

@designatednerd designatednerd added this to the Next Release milestone Jun 29, 2020
@designatednerd
Copy link
Contributor

This fix has shipped with 0.29.0. If you are still having problems after upgrading to that version, please open a new issue with details, noting that you are using that version. Thank you!

@HardikKardani
Copy link
Author

Thanks @designatednerd

Will check and inform you.

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

No branches or pull requests

2 participants