You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 fileWriteStreamHandler needs to be typed.:
In order to do that, I need something like a return value from the uploadStream function where I would be able to receive the final information eventually. But since it is only returning a PassThrough-object, it seems to be very limited in that case for further approaches like mine.
Do you guys know how I can do that?
The text was updated successfully, but these errors were encountered:
Have you tried to res.end inside the s3Client.upload callback (you need to have a ref to res there)
Thanks for mentioning this! As for now, in my first tests, it works as expected. I will investigate it a little more and close this ticket once this approach has been tested more
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
fileWriteStreamHandler
needs to be typed.:form.parse
returns immediately, no matter how long the S3-upload process works under the hood.I tried to use a
promise
andawait
but the function type ofuploadStream
must 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
uploadStream
function 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?
The text was updated successfully, but these errors were encountered: