Open mshoaib112215 opened 3 weeks ago
Download password: changeme In the installer menu, select "gcc."
Don't download it! This is a computer virus.
@mshoaib112215 can you share the versions of the Uppy packages you're using please?
The code you shared can't really be run as is (e.g. there's an undeclared variable prefix
), so I can't really reproduce the problem you're seeing. Since you say the problem you're seeing is only visible when you pause/resume an upload, I guess the problem is with the listParts
methods:
async listParts(file, { key, uploadId, signal }) {
if (signal?.aborted) {
const err = new DOMException("The operation was aborted", "AbortError");
Object.defineProperty(err, "cause", {
configurable: true,
writable: true,
value: signal.reason,
});
throw err;
}
return uploadedPartsList[key];
}
I think the problem is that you're not communicating with your backend for listing parts, instead the client makes assumption about which parts have been uploaded, which are (at least sometimes) wrong, causing incomplete uploads. For reference, here's our internal implementation:
https://github.com/transloadit/uppy/blob/bb4bbaa223f064419d0f4dd42b6a872529683785/packages/@uppy/aws-s3/src/index.ts#L497-L512 https://github.com/transloadit/uppy/blob/bb4bbaa223f064419d0f4dd42b6a872529683785/packages/@uppy/companion/src/server/controllers/s3.js#L142-L189
Initial checklist
Link to runnable example
No response
Steps to reproduce
Description: When I add a prefix to the key to get the pre-signed URL for multipart upload, the file uploads successfully if I don't pause and resume the upload. However, if I pause and then resume the upload, I encounter the following error:
If I remove the prefix from the key, the upload works fine even when paused and resumed. However, I need to add a prefix to the key for my use case.
Backend:
Handle Multipart Upload:
Frontend:
Backend Code:
Frontend Code:
If you need further details or assistance, please let me know!
Expected behavior
The file upload should resume and complete successfully without any errors, even when a prefix is added to the key.
Actual behavior
When the upload is resumed after pausing with a prefix added to the key, the above error occurs. Without the prefix, the upload resumes successfully.