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
600 stars 168 forks source link

multiple users uploads fails #144

Open IgorChec opened 1 year ago

IgorChec commented 1 year ago

Hi,

If we have 2 users uploading file at the same time, first user will finish with success and second user upload will be stopped at the moment first finishes.

Problem is in file listings from /chunks directory. Basically there is situation when broken file upload take all files from /chunk folder, then first upload finished and delete part files, after that second upload is broken, because when file already taken in files list is deleted code breaks.I am using resumable.js.

Does anyone have same problem or know the solution?

| This Package Version | 1.5.1 | Laravel Framework Version | 9.0 | PHP version | 8.1 | Operating system | ubuntu 22.04

pionl commented 1 year ago

Make sure that your JS logic generates unique ID (depends on the library you are using).

IgorChec commented 1 year ago

HI

I am using resumable.js, upload from diff browsers/ diff users / diff sessions. I can confirm that generateUniqueIdentifier() returns unique names.

This is error I am getting:

[2022-12-02 07:37:15] local.ERROR: Unable to list contents for 'chunks/', shallow listing

Reason: SplFileInfo::getMTime(): stat failed for /var/www/html/hgf-backend/storage/videos/chunks.....

Can this package be used for parallel uploads at the same time (diff logged users at the same time), because as I see it from logs and test this is not possible?

chandlerwilcox88 commented 1 year ago

@IgorChec does this thread answer your question?

https://github.com/pionl/laravel-chunk-upload/issues/27