jw-12138 / r2-uploader

Web Interface for Cloudflare R2
https://r2.jw1.dev
MIT License
147 stars 61 forks source link

Multipart rename upload fails (attempts to complete with original filename) #6

Closed spurin closed 4 months ago

spurin commented 4 months ago

Hi @jw-12138,

I've switched over to the updated code base and when using the multipart upload, it fails to complete when using the rename option. If I toggle off the rename option, all works as expected.

In the network inspector I can see that it's attempting to call mpu/complete/filename using the original filename, rather than the renamed filename.

Raising this here but I'm guessing, this is possibly an issue relating to https://github.com/jw-12138/r2-uploader-example-worker

Many Thanks

James

spurin commented 4 months ago

Screenshot:

Filename uploaded with rename option, gets to 100% and gets stuck -

image

Each part is using the renamed filename -

image

Request made to mpu/complete (incorrectly using the original filename and failing)

image image
spurin commented 4 months ago

Further to my last update, I've been experimenting with Vercel which I doubt I would have looked at without this project, it's superb :-)

From my own branch, I've implemented a fix, tested and raised a pull request above.

jw-12138 commented 4 months ago

this PR has been merged and deployed to r2.jw1.dev, thanks for that!

what a silly mistake i've made 😵‍💫

jw-12138 commented 4 months ago

also did a refactor, all mpu-related functions are now using the fileName formatted from the uploadFile function so we don't have to read the value again.

image
jw-12138 commented 4 months ago

@spurin thanks again for the PR, the client side code is a mess and poorly documented, yet you still put this much efforts on it ❤️😭!

spurin commented 4 months ago

Many thanks again @jw-12138

Love this project and also appreciate your timely help and support 🙌