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 panics #14

Closed
nicolaiunrein opened this issue Apr 2, 2020 · 1 comment
Closed

Upload panics #14

nicolaiunrein opened this issue Apr 2, 2020 · 1 comment

Comments

@nicolaiunrein
Copy link
Collaborator

I get the following error when trying to upload a .png:
panicked at 'byte index 19 is not a char boundary; it is inside '|' (bytes 18..19) of `test.png:image/png|PNG`

And this is my form data:

Content-Disposition: form-data; name="operations"

{"operationName":"upload","variables":{"file":null},"query":"mutation upload($file: Upload!) {\n  upload(file: $file)\n}\n"}
------WebKitFormBoundaryF5RA2VMgDmAIU1OT
Content-Disposition: form-data; name="map"

{"1":["variables.file"]}
------WebKitFormBoundaryF5RA2VMgDmAIU1OT
Content-Disposition: form-data; name="1"; filename="test.png"
Content-Type: image/png


------WebKitFormBoundaryF5RA2VMgDmAIU1OT--

@sunli829
Copy link
Collaborator

sunli829 commented Apr 3, 2020

I caused this problem by saving the file contents directly into the string, and now I base64 it.

@sunli829 sunli829 closed this as completed Apr 6, 2020
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