-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass getUploadParameters
response value to upload()
result
#4635
Comments
I think that's no longer true since we fixed #4613. |
I have set the following CROS configuration in both Cloudflare R2 and AWS S3 [
{
"AllowedHeaders": [
"Authorization",
"x-amz-date",
"x-amz-content-sha256",
"content-type"
],
"AllowedMethods": [
"PUT",
"GET"
],
"AllowedOrigins": [
"http://localhost:3000"
],
"ExposeHeaders": [
"ETag",
"Location"
],
"MaxAgeSeconds": 3000
},
{
"AllowedHeaders": [],
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": [],
"MaxAgeSeconds": 3000
}
] One thing to note is that the file is still getting uploaded / store in the bucket. I am still getting Aside from that, I would also like to discuss about the feature request (as mentioned in this issue description) to pass additional data generated by the methods:
to make it available in the |
Sorry, I didn't notice your code snippet contained a slight error, here's how to get the uppy.upload()
.then(async (result) => {
console.log('result', result.successful[0].response.uploadURL);
})
If you come up with a proposal, we can discuss it further, but I doubt we would be able to do it in a clean manner. Besides, |
You're right, sorry I misread, Can you give more info on your setup? What package/version are you using? What options are you using? Specifically, are you using |
I have created a separate react hook for using Uppy for file upload without using Multipart upload. return new Uppy({
id: id || 'FileUploader',
restrictions: {
maxNumberOfFiles: 1,
allowedFileTypes,
maxFileSize,
},
}).use(AwsS3, {
id: 'FileUpload',
shouldUseMultipart: false,
getUploadParameters: async (file) => {
const response = // make API call to get `uploadFileUrl`
return {
method: 'PUT',
url: response.uploadFileUrl,
};
},
});
What options are you using? Specifically, are you using shouldUseMultipart option? Just for context. Yes, I am using multipart upload in same project at other places and it is working fine. For this specific use-case I am trying to upload a file in a single request. |
Initial checklist
Problem
Inside
getUploadParameters
function, in additional to generating apreSignedUrl
, there is some additional information returned from same endpoint. We need to access that additional information on the client side once the upload is successful.After executing the
upload()
method, there is no way to access thatdata
after successful upload.Solution
It would be nice to be able to access the data something like this:
Alternatives
S3 API do not return the
Location
response header and Uppy just returnsundefined
for uploadURL.Maybe add support for
uploadURL
.The text was updated successfully, but these errors were encountered: