You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you make an upload that leads to more than 10 chunks, they are appended in the wrong order.
I think this has to do with the sort function which does not take the part numbers into account correctly.
So file xxxxxxxx-10.part is appended before xxxxxxxx-2.part because of the sorting.
I have already applied the fix proposed in another thread by setting browser = true and session = false
for the filenames. So I assured my part filenames are consistent throught the whole upload.
I am using dropzone.js to handle the upload client side, and I checked that the chunk indexes, order and total are all correct.
Sorting the files with natural case seems to fix the problem.
In function buildFullFileFromChunks() from ParallelSave.php
$chunkFiles = $this->savedChunksFiles()->sort();
I replace with this
// Sorting file collection with natural case so xxxx-10.part does not get before xxxx-2.part
$chunkFiles = $this->savedChunksFiles();
$items = $chunkFiles->all();
natcasesort($items);
$chunkFiles = collect($items);
And it solves the problem.
If this a mistake from me that can be resolved without updating the plugin, I'll be happy to be directed to the solution.
Apart from this, it is an excellent plugin :-).
The text was updated successfully, but these errors were encountered:
kerwan
changed the title
Chunk are appended in the wrong order
Chunk are appended in the wrong order when the upload creates 10 chunks or more
May 23, 2018
Sorry for the problem, my bad. You are correct. I thought that Collection->sort will handle this. I've tested the sorting without special chars and it sorted correctly. Didn't have to much to test it properly - currently not using project that needs this 😣
I'm using this for a project that will use various file sizes (from very small to a few GB) so I'll be happy to give feedback about this whenever I can.
If you make an upload that leads to more than 10 chunks, they are appended in the wrong order.
I think this has to do with the sort function which does not take the part numbers into account correctly.
So file xxxxxxxx-10.part is appended before xxxxxxxx-2.part because of the sorting.
I have already applied the fix proposed in another thread by setting browser = true and session = false
for the filenames. So I assured my part filenames are consistent throught the whole upload.
I am using dropzone.js to handle the upload client side, and I checked that the chunk indexes, order and total are all correct.
Sorting the files with natural case seems to fix the problem.
In function buildFullFileFromChunks() from ParallelSave.php
I replace with this
And it solves the problem.
If this a mistake from me that can be resolved without updating the plugin, I'll be happy to be directed to the solution.
Apart from this, it is an excellent plugin :-).
The text was updated successfully, but these errors were encountered: