jaydenseric / graphql-upload

Middleware and an Upload scalar to add support for GraphQL multipart requests (file uploads via queries and mutations) to various Node.js GraphQL servers.
https://npm.im/graphql-upload
MIT License
1.43k stars 132 forks source link

upload multiple images has error #384

Closed hajmansoor closed 6 months ago

hajmansoor commented 7 months ago

When I want to upload multiple images only the first file has "file" content and the other file does not have file content(only file with extension .png .xls . ) file with txt format worked fine image

please help me

jaydenseric commented 6 months ago

It's not clear why you are accessing the Upload instances directly; if everything is setup correctly with the scalar GraphQLUpload you won't see that in resolvers; only you can access the upload promise. You need to properly await the upload promise, then use that to create and promisify a readable stream for the upload, and then await the completion of the stream. You have to do something with the upload stream, even if you just waste it. Streams of files in multipart requests are received one after another, not in parallel.