pionl / laravel-chunk-upload

The basic implementation for chunk upload with multiple providers support like jQuery-file-upload, pupload, DropZone and resumable.js
MIT License
617 stars 167 forks source link

Proposal: Should ignore user abort #52

Open nerg4l opened 6 years ago

nerg4l commented 6 years ago

I think ignore_user_abort(true) should be used inside ParallelSave::buildFullFileFromChunks method merges the chunk files. If the client disconnects during that process some of the chunks gets deleted and a partialy merged file is created. By ignoring user abort the process could finish without any problem.

This also applies to ChunkSave. During the merge of the last chunk user abort could be ignored. With this, the last merge and the move could finish without interruption.

This could lead to some inconsistency after the client reconnects.

Maybe this could be configurable and being disabled by default.

pionl commented 6 years ago

Not a bad idea. Probably should be default implementation. We could even check connection_aborted and delete the file.

isFinished should also return false.

Will look into it in near future.