Uploading Image or other non text file gets corrupted || File Upload example Not working
See original GitHub issueDescribe the bug
I use graphql-yoga
with NextJS and whenever I try to upload images, pdf or any other non-text file it gets corrupted whenever I use arrayBuffer()
. And it seems stream()
does not work as well
.
Your Example Website or App
https://gist.github.com/richieroldan/a1d518b7b6279d106a2cd2fb4ebb3d76
Steps to Reproduce the Bug or Issue
- Create NextJS app
yarn create next-app --typescript
- create
pages/api/graphql.ts
- setup the graphql-yoga server
- add mutation with file upload
- run
yarn dev
- try to upload non-text file
Expected behavior
I should be able to save images, pdf, and any other files without corrupting them.
Screenshots or Videos
No response
Platform
- OS: MacOS (Intel)
- NodeJS: 14.17.1
- Tried
@graphql-yoga/*
version(s): 2.10.0 and 2.0.0
Additional context
No response
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
python - Uploading images get corrupted but not txt files
I am trying to upload an image using AWS lambdas but my images get corrupted I tested with a txt file and it...
Read more >Images upload but don't display because they are corrupted
Text files are working. I created a simple text file and uploaded it to a page node. Then navigated to the page, clicked...
Read more >How You Can Fix The Biggest Problem With React File ...
Under certain conditions, a file uploader will immediately report a server error where the console tracks a file upload, but it does not...
Read more >7 Reasons Why Images Are Not Loading on Your Website
Website images fail to load for one of these seven common reasons.
Read more >Fix problems uploading files on the OneDrive website
If the file is on a server, make sure you can open the file, and then try to upload it again.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The documentation and examples will be fixed as part of https://github.com/dotansimha/graphql-yoga/pull/1332
That’s good @n1ru4l ! I can confirm that it works! Thanks a lot!
Will close this issue now.