Code Monkey home page Code Monkey logo

Comments (20)

pionl avatar pionl commented on May 28, 2024

Hi, thank you 👍

can you share the JS code you are using? Also, could you check if chunks are created?

Martin

from laravel-chunk-upload.

sagarrabadiya avatar sagarrabadiya commented on May 28, 2024

image

it is pretty much standard js nothing special i am using and yes i can see chunk directory is created under storage/app

from laravel-chunk-upload.

sagarrabadiya avatar sagarrabadiya commented on May 28, 2024

i can see the calls are being made to server for chunks by dropzone, and response are coming in the percentage, as i am using exact same backend implementation given in example so each chunk upload request's response is percentage but in last chunk it should give different response but currently its giving 100 as percentage so isFinished() give false

from laravel-chunk-upload.

sagarrabadiya avatar sagarrabadiya commented on May 28, 2024

i have checked and chunks are not created? so what could be the problem?

from laravel-chunk-upload.

sagarrabadiya avatar sagarrabadiya commented on May 28, 2024

changing the chunk disk to public works.

from laravel-chunk-upload.

vedmant avatar vedmant commented on May 28, 2024

I have the same issue, it's stopped working after I changed storage.disk option to a custom disk. I use resumable.js.

from laravel-chunk-upload.

pionl avatar pionl commented on May 28, 2024

I will investigate this issue - will check why different disk is not working. @sagarrabadiya Can you show me you disk config so I can test it on your settings? Thank you

from laravel-chunk-upload.

vedmant avatar vedmant commented on May 28, 2024

In my case that's just another local disk:

    'shared' => [
        'driver' => 'local',
        'root' => storage_path('shared'),
    ],

from laravel-chunk-upload.

sagarrabadiya avatar sagarrabadiya commented on May 28, 2024

i used public disc but that didnt work so i canhed to local disk and made chunk folder permission 777 and then it started creating chunks

from laravel-chunk-upload.

vedmant avatar vedmant commented on May 28, 2024

In my case all chunks are stored normally but after uploading the last one isFinished() is still false, so it can't complete uploading and assemble final file. I will investigate it further next week and can make a pull request if I find a solution.

from laravel-chunk-upload.

pionl avatar pionl commented on May 28, 2024

@vedmant Did you use simul. upload? New version fixes this: #38

@sagarrabadiya public dir should not be used for this while using Storage. This will be probably this issue. But I will try it too and update the wiki for further use.

from laravel-chunk-upload.

vedmant avatar vedmant commented on May 28, 2024

@pionl I use default resumable.js setting for this, by default it has 3 simultaneous uploads. I use latest version 1.2.4. On my server I use multiple php-fpm containers and shared mount disk between them so all containers have access to all chunks. Sessions are shared through DB.

from laravel-chunk-upload.

Saarnaki avatar Saarnaki commented on May 28, 2024

I also confirm this issue with ResumableJS.
In localhost (OSX with Xampp) everything works nicely, but in production (Centos 7 & nginx) it would always returns false.

During my several hours of investigation (and banging my head against the wall because of this issue) I seem to have narrowed down the cause - ParallelSave.php method handleChunk().

It appears that on my production machine the final chunk test fails. Haven't gotten around to test it whether the issue is that $files->count() + 1 behaves somehow differently on nginx or $this->totalChunks is messed up.

In my case I solved it like this:

  • removed the handleChunk() method, leaving the last chunk test to be done in the ChunksInRequestUploadHandler
  • to Resumable options added simultaneousUploads: 1

And now it's working. Maybe not the best solution but works for me as a quick solution since our product is in beta and already used by many users.

from laravel-chunk-upload.

sagarrabadiya avatar sagarrabadiya commented on May 28, 2024

i would love to see this issue fixed, this causes many messes 😆 @pionl were you able to regenerate this problem? i will advise you to try to reproduce it under linux environment with nginx. for me also linux nginx environment got the problem changing simultaneousUploads to 1 works, but having multiple chunks makes upload faster (so a bit sacrifice on speed).

from laravel-chunk-upload.

pionl avatar pionl commented on May 28, 2024

I use vagrant with linux + apache + php 7.0 and works as expected.

But I've found incomplete implementation (bugs):

  1. The files detection where missing correct filtering, if there was any additional un-completeded chunks from different file it caused bug. -> Can be fixed (I've already done on my repo)
  2. Percentage are not correct - uses the chunk number, if I use file count, it can return 100% on multiple requests. Leaving the chunk count
  3. The second problem is, that if I send smaller file (max. 3 sim. uploaded set, file is separated into 3 chunks). At the same time, all files are created and I can't detect which request is "final" because all request can detect 3 uploaded files. Even using lock file will not help (tried). (@Saarnaki and @sagarrabadiya reports) The solution could be:

a. Use queue which would solve the issue - not ideal if you need the response
b. Use only last chunk for detection - this is probably not ideal but only solution I've found. If I recall correctly from the docs, the last chunk could not be sent in last request. But at this moment it is ok. This solution will not work if resumable uploads will be implemented.

At this moment, I do not have to much time. Even this implementation was made on request between projects. Sorry for the mistakes, while testing large files the error didn't occur. Unfortunately I do not use this package at this moment in any project so the focus on changing things is hard to find.

At least this morning I've fixed this issue (at least 2.5h), please try the master branch and let me know. Now works (large/small files)

The different storage is not implemented at this moment. If anyone needs this functionality, please make a PR. The original issue from @sagarrabadiya. It is recommended by the laravel framework to use the storage/app folder and make a symlink to used folder

from laravel-chunk-upload.

pionl avatar pionl commented on May 28, 2024

As for me, the change works. I've released new version to prevent any further issues for new users. Let me know if works better now. Thanks

Version: 1.2.6

from laravel-chunk-upload.

sagarrabadiya avatar sagarrabadiya commented on May 28, 2024

i still am having issue with resumablejs parellel chunk uploads and didn't have time to send PR to this package, so i moved to https://github.com/dilab/resumable.php package which i think is official php backend for resumable.js, will probably send PR to this package later to fix the problem, thanks for your efforts and time @pionl 👍

from laravel-chunk-upload.

pionl avatar pionl commented on May 28, 2024

Strange, by checking the code it and works similar as previous implementation (just checking if chunk exists by number of chunks), there should be similar issues while sending small chunk (only 3 chunks by using 3 parallel requests).

Sorry for the troubles. Currently I'm not able to reproduce the bug (using chunk-example). How big file you are testing? Make sure you are using storage/app folder (by default config) and it should work.

from laravel-chunk-upload.

sagarrabadiya avatar sagarrabadiya commented on May 28, 2024

yes all the configs are default and using 4 chunks parellel. i am using upload endpoint as api with laravel passport oauth2 so may be that is the issue as it uses session id to make file unique but not so sure about it.

from laravel-chunk-upload.

pionl avatar pionl commented on May 28, 2024

It should automatically detect if session is ready and fallback to browser agent. Still resumable sends also it's custom identifier so it should be ok.

If you have time, it should be easy to debug the flow or I can add Log::debug logs to help identify the problem.

I would check this line for the number of chunks detected on each request: https://github.com/pionl/laravel-chunk-upload/blob/master/src/Save/ParallelSave.php#L103

from laravel-chunk-upload.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.