23 / resumable.js

A JavaScript library for providing multiple simultaneous, stable, fault-tolerant and resumable/restartable uploads via the HTML5 File API.
MIT License
4.65k stars 611 forks source link

Upload method is not dynamic #615

Open congthanhnguyenOL opened 9 months ago

congthanhnguyenOL commented 9 months ago

Hi team, thanks for building and maintaining this awesome library.

I am facing a challenge, which is that I cannot dynamically configure the uploadMethod, since it only accepts strings, not functions.

My use-case is that I have to dynamically decide if I can upload a file to S3 (yes if I can obtain the pre-signed URLs, no elsewise), if not I fallback to uploading to another server. The struggle is that S3 only allow PUT requests, meanwhile the other server only accept POST requests, thus the need for configuring uploadMethod dynamically.

Can it be done? Thanks!