how to handle maxFileSize errors with graphqlUploadExpress
See original GitHub issueHello, sorry if this is a duplicate, i didn’t found it.
How one can handle the maxFileSize error with express?
I am seeing this error
UnhandledPromiseRejectionWarning: PayloadTooLargeError: File truncated as it exceeds the 100000 byte size limit.
But I don’t see how to attach any callback to the graphqlUploadExpress
Thanks
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
graphqlUploadExpress maxFileSize restriction not work #274
Hi guys I have this config in my nestjs api main.ts const { API_UPLOADS_MAX_FILESIZE, API_UPLOADS_MAX_FILES } = process.env; ...
Read more >How to use the graphql-upload.graphqlUploadExpress ... - Snyk
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >File upload error in graphql apollo-server - Stack Overflow
I am learning graphql .I followed this article https://dev.to/dnature/handling-file-uploads ...
Read more >graphql-upload - npm
Handle file upload promise rejection and stream errors; uploads sometimes ... graphqlUploadExpress({ maxFileSize: 10000000, maxFiles: 10 }),.
Read more >NestJS file upload with GraphQL - Dilusha Dasanayaka
Here we going to use graphql-upload package additionally to handle the file ... app.use(graphqlUploadExpress({ maxFileSize: 1000000, maxFiles: 10 }));
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 Free
Top 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
I’m sorry but it does not seem to work with my current set-up.
It seems that the error is launched when
createReadStream
because the file is bigger than the size. Anyway, wrappingcreateReadStream
with a try/catch seems to work for me! Thanks Mr jaydenseric. May the force be with youHow do you handle the file upload stream errors?
I just followed the documentation: