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
@uppy/aws-s3-multipart Replace functionality lost in v2 by batching with prepareUploadParts #3881
Comments
Current return value of {
"presignedUrls": {
"1": "https://bucket.region.amazonaws.com/path/to/file.jpg?partNumber=1&...",
"2": "https://bucket.region.amazonaws.com/path/to/file.jpg?partNumber=2&...",
"3": "https://bucket.region.amazonaws.com/path/to/file.jpg?partNumber=3&..."
},
"headers": { "some-header": "value" }
} Proposal: function prepareUploadParts(file, { uploadId, key, parts }) {
const presignedRequests = parts.map((part) => {
const { number, chunk } = part;
const url = `https://bucket.s3.us-east-2.amazonaws.com/test/upload/multitest.dat?partNumber=${number}&...`;
const hash = calculateMD5(chunk);
return new Request(url, { headers: { "Content-MD5": hash } });
});
return { presignedRequests };
} Changes:
Curious about your thoughts @mifi @aduh95 @arturi @martin-brennan |
Thanks for moving this forward, @Murderlon and @kevin-west-10x . It will be very useful for us as well. If possible, it would be awesome to also support the other/additional checksums that AWS now accepts as integrity checks on S3 (https://aws.amazon.com/blogs/aws/new-additional-checksum-algorithms-for-amazon-s3/) |
I'm not immediately sure what it takes for us to support those. Probably better to tackle as a separate issue. Would you be willing to investigate a bit to create an issue with pointers what needs to change in the codebase? |
@Murderlon : Sure, added an issue: #3885 |
sounds good, but should file be part of the object arg? and does it need to return an object? one concern is maybe some users need to do asynchronous calculations in order to get the hash. so maybe the function should be async? what about this: async function prepareUploadParts({ file, uploadId, key, parts }) {
return parts.map((part) => {
const { number, chunk } = part;
const url = `https://bucket.s3.us-east-2.amazonaws.com/test/upload/multitest.dat?partNumber=${number}&...`;
const hash = calculateMD5(chunk);
return new Request(url, { headers: { "Content-MD5": hash } });
});
} |
We could do that too, yes.
|
Closed in #3895 |
The breaking change in v2 of @uppy/aws-s3-multipart that migrates
prepareUploadPart
toprepareUploadParts
loses some fine grained functionality that in my case is preventing me from updating from v1. I need this functionality in order to calculate md5 hashes of the parts I'm preparing so they can be validated on s3. The two changes I can see that caused an issue are:Content-MD5
of each individual part.Being able to batch create the presigned urls isn't a bad option to have, but it would be nice if this functionality could be restored in some way.
The text was updated successfully, but these errors were encountered: