muxinc / upchunk

Uploads Chunks! Takes big files, splits them up, then uploads each one with care (and PUT requests).
MIT License
336 stars 46 forks source link

Allow custom content-range header #78

Closed blairliikala closed 2 years ago

blairliikala commented 2 years ago

Moving when optional headers are applied to the end should allow overwriting the Content-Range header.

The primary need for overwriting this parameter is to pass custom content-range headers for when the size is unknown, such as a live recording in MediaRecorder.

UpChunk.createUpload({
  endpoint: url,
  file: file,
  headers : {
     'Content-Range': `bytes ${start}-${end}/*`,
});
mmcc commented 2 years ago

Hmm this is interesting, but for this to work wouldn't we also need to refactor things to allow Content-Range to accept a function?

cjpillsbury commented 2 years ago

Closing due to inactivity & discussion considerations.

mmcc commented 2 years ago

I also think #86 would be a path forward to be able to accomplish the same goal here!