-
-
Notifications
You must be signed in to change notification settings - Fork 688
How to wait for the result of writeHandler in a formidable file upload request? #977
Copy link
Copy link
Open
Labels
Area: filesThings related to handling files, names, etc.Things related to handling files, names, etc.Area: streamsThings related to handling streams, and bugs around them.Things related to handling streams, and bugs around them.Priority: LowThis issue can probably be picked up by anyone looking to contribute to the project.This issue can probably be picked up by anyone looking to contribute to the project.Status: AvailableNo one has claimed for resolving this issue. Generally applied to bugs and enhancement issues.No one has claimed for resolving this issue. Generally applied to bugs and enhancement issues.Type: QuestionA query or seeking clarification. Probably doesn't need the attention of everyone.A query or seeking clarification. Probably doesn't need the attention of everyone.
Metadata
Metadata
Assignees
Labels
Area: filesThings related to handling files, names, etc.Things related to handling files, names, etc.Area: streamsThings related to handling streams, and bugs around them.Things related to handling streams, and bugs around them.Priority: LowThis issue can probably be picked up by anyone looking to contribute to the project.This issue can probably be picked up by anyone looking to contribute to the project.Status: AvailableNo one has claimed for resolving this issue. Generally applied to bugs and enhancement issues.No one has claimed for resolving this issue. Generally applied to bugs and enhancement issues.Type: QuestionA query or seeking clarification. Probably doesn't need the attention of everyone.A query or seeking clarification. Probably doesn't need the attention of everyone.
I want to use formidable to upload files directly to S3. Following the official example it works just fine. However, I want to await the upload process and return the final URL of the uploaded file inside of the Http-Request to my client. And this seems to be a a challenge due to the limited nature of how
fileWriteStreamHandlerneeds to be typed.:form.parsereturns immediately, no matter how long the S3-upload process works under the hood.I tried to use a
promiseandawaitbut the function type ofuploadStreammust not return a promise.I want to achieve something like that:
In order to do that, I need something like a return value from the
uploadStreamfunction where I would be able to receive the final information eventually. But since it is only returning aPassThrough-object, it seems to be very limited in that case for further approaches like mine.Do you guys know how I can do that?