Skip to content

Commit

Permalink
Merge pull request #28 from G4brym/fix-multipart-upload
Browse files Browse the repository at this point in the history
Fix multipart upload
  • Loading branch information
G4brym authored Sep 7, 2023
2 parents 2ca902f + 47949eb commit 9de48bc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
1 change: 0 additions & 1 deletion packages/dashboard/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ const apiHandler = {
});
},
multipartComplete: (file, folder, parts, uploadId) => {
const key = apiHandler.getKey(folder, file.name);
return axios.post(`/api/buckets/${store.state.activeBucket}/multipart/complete`, {
key: encodeKey(file.name, folder),
uploadId,
Expand Down
17 changes: 8 additions & 9 deletions worker/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"wrangler": "^3.6.0"
},
"dependencies": {
"@cloudflare/itty-router-openapi": "https://prerelease-registry.devprod.cloudflare.dev/itty-router-openapi/runs/5881739194/npm-package-itty-router-openapi-83",
"@cloudflare/itty-router-openapi": "^1.0.1",
"postal-mime": "^1.0.16"
},
"bin": {
Expand Down
7 changes: 1 addition & 6 deletions worker/src/buckets/api/multipart/createUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ export class CreateUpload extends OpenAPIRoute {
httpMetadata = JSON.parse(decodeURIComponent(escape(atob(data.query.httpMetadata))))
}

const multipartUpload = await bucket.createMultipartUpload(key, {customMetadata: customMetadata, httpMetadata: httpMetadata});

return {
uploadId: multipartUpload.uploadId,
key: multipartUpload.key,
}
return await bucket.createMultipartUpload(key, {customMetadata: customMetadata, httpMetadata: httpMetadata});
}
}

0 comments on commit 9de48bc

Please sign in to comment.