Improve documentation for handling results of uploads in express/koa
See original GitHub issueI didn’t want to file an issue but am not sure where to get help.
I’ve followed the steps to get the express middleware working, I’ve followed tutorials for sending in the query from my client side, but I don’t understand what to do in my express controller handling the actual file.
In my arguments, all I get is an object of { file: { path: 'filename.png' } }
The file doesn’t exist in the os.tmpdir, I can’t use createReadStream on it, etc.
It’s possible I’m not sending in the data right, but I’ve structured my api query just like other tutorials did:
query: `
mutation($file: Upload!) {
server:createServer(
input: {
bannerFile: $file,
name: "${values.serverName}",
address: "${values.serverAddress}",
description: "${values.serverDescription}"
}) { id }
}`,
variables: {
file: values.bannerFile // this comes directly from the files from a file input.
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (6 by maintainers)
Top Results From Across the Web
typestack/routing-controllers - GitHub
Routing-controllers uses multer to handle file uploads. You can install multer's ... You can use any existing express / koa middleware, or create...
Read more >Upload Documents for Assessment Verification
Upload Documents for Assessment Verification Print ... The Verification Report compiles a list of the selected questions from a user's Assessment ...
Read more >Regulatory Management: Working with Documents
Uploading, Editing, Comparing, and Deleting Documents. Do's and Don'ts for Uploading Files to eResearch Regulatory Management ...
Read more >Issues Uploading Documents: Common Errors, Causes, and ...
The issues and solutions presented here are meant to help troubleshoot issues when uploading documents using the DocuSign web application only.
Read more >Error handling — Boto3 Docs 1.26.37 documentation
Overview¶. Boto3 provides many features to assist in navigating the errors and exceptions that you might encounter when interacting with AWS services.
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
Ok, I went through and moved my schema creation over to
makeExecutableSchema
. I had to tweak the signatures of all my methods but it appears to be working better now. I no longer see a nested.file
but can useconst { mimetype, createReadStream } = await input.bannerFile;
directly.Ok you’re probably right. I’ll look into that and report back. Appreciate your help and time.