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'm building a serverless React app (using npm for development), that uses DropzoneS3Uploader to upload images to S3. I'm configuring it to use API Gateway (backed by Lambda) to request a signed URL before uploading a file to an S3 bucket
However it goes straight from that into a 404 (stacktrace below). I'm starting to wonder if npm tries to cache the image as a temp file? Whatever the problem it cant seem to reference the server/image during the PUT request to S3...
There is a 'server' option as part of the DropzoneS3Uploader upload options. Leave it blank and i get this error, populate it with someone else and it replaces error with whatever server URL I mention. As mentioned, I plan to run this serverless so dont have a server to mention.
I switch to Dropzone and use axios and it works ok, so am wondering if DropzoneS3Uploader is just abstracting too much of the implementation code away to allow this behaviour to be controlled?
Thanks!
The text was updated successfully, but these errors were encountered:
I'm building a serverless React app (using npm for development), that uses DropzoneS3Uploader to upload images to S3. I'm configuring it to use API Gateway (backed by Lambda) to request a signed URL before uploading a file to an S3 bucket
const uploadOptions = {
s3Path: '//',
signingUrl: 'https://.eu-west-1.amazonaws.com/Prod/',
signingUrlMethod: 'POST',
accept: 'image/*',
autoUpload: true
};
The render method goes on to return component as follows...
When this is executed it manages to generate the signed URL fine..
Request URL: https://.eu-west-1.amazonaws.com/Prod/?objectName=&contentType=image%2Fjpeg Request Method: POST Status Code: 200
{"signed_url":"https://.eu-west-1.amazonaws.com/<some_image.jpg>?X-Amz-Algorithm=AWS4-HMAC-....X-Amz-Signature=...&X-Amz-SignedHeaders=host"}
However it goes straight from that into a 404 (stacktrace below). I'm starting to wonder if npm tries to cache the image as a temp file? Whatever the problem it cant seem to reference the server/image during the PUT request to S3...
Request URL: http://localhost:3000/undefined Request Method: PUT Status Code: 404 Not Found
http://localhost:3000/undefined 404 (Not Found) ./node_modules/react-dropzone-s3-uploader/node_modules/react-s3-uploader/s3upload.js.S3Upload.uploadToS3 @ s3upload.js:171 (anonymous) @ s3upload.js:108 XMLHttpRequest.send (async) ./node_modules/react-dropzone-s3-uploader/node_modules/react-s3-uploader/s3upload.js.S3Upload.executeOnSignedUrl @ s3upload.js:113 ./node_modules/react-dropzone-s3-uploader/node_modules/react-s3-uploader/s3upload.js.S3Upload.uploadFile @ s3upload.js:178 (anonymous) @ s3upload.js:53 ...
There is a 'server' option as part of the DropzoneS3Uploader upload options. Leave it blank and i get this error, populate it with someone else and it replaces error with whatever server URL I mention. As mentioned, I plan to run this serverless so dont have a server to mention.
I switch to Dropzone and use axios and it works ok, so am wondering if DropzoneS3Uploader is just abstracting too much of the implementation code away to allow this behaviour to be controlled?
Thanks!
The text was updated successfully, but these errors were encountered: