0

We need to call a third party lib, ideally at the time of onUploadChunk callback. As shown in the documentation (http://docs.fineuploader.com/branch/master/api/events.html#uploadChunk), we can have some parameters in order to identify the chunk and do stuff with the javascript slice method.

But, the question is : how to give back updated chunk into the fineuploader upload process ?

Thanks a lot for help.

choomz
  • 135
  • 11

1 Answers1

0

You cannot modify the chunks created by Fine Uploader, nor should you be able to as it may change the size of the chunk, the expected total number of chunks, and require adjustments of internal state and sent parameters. If you'd like to modify any files, you have two options:

  1. Modify the file before it is sent to to Fine Uploader
  2. Modify the file before the file upload begins. You can cancel the original file, and then submit the changed versions via the addFiles API method.
Ray Nicholus
  • 19,538
  • 14
  • 59
  • 82
  • Thanks for you answer. Maybe you should know that we won't modify the chunk size, but only replace some bytes in some chunk. With this new information, is there any method to do it ? Or should we need to modify the core ? We can't load the entire file in memory in order to modify it. – choomz Jun 25 '15 at 15:37
  • Can you please post some code to show us what you mean with your #2 point ? Maybe it could work for us. Thanks a lot. – choomz Jun 25 '15 at 15:45
  • Simply [get the file](http://docs.fineuploader.com/branch/master/api/methods.html#getFile), modify it however you desire, cancel the original, then submit the new `Blob` via addFiles. Is there something specific here you are struggling with? – Ray Nicholus Jun 25 '15 at 16:04
  • Hi RayNicholus I came across this post when trying to look to see if this issue has been tacked before - my use-case is for files that are too large to fit in memory (multi-gigabyte files) that I wish to transform (e.g. encrypt) on the fly and pass as chunks to FineUploader. It is feasible for me to calculate the post-transformation file-size at the start, but it is not feasible for me to do on-disk manipulation of the file (only in-memory). Is there a way FineUploader can support this use case? – Numbat Jan 06 '16 at 03:52