-
-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Framework Support #41
Comments
@s1rc I added a rough doc for Laravel integration: https://github.com/ankitpokhrel/tus-php/wiki/Laravel-&-Lumen-Integration |
Thank you, I will give this a try! |
So far so good! One quick change to your Wiki article. In the route definition, the parameter needs to be optional. Route::any('/tus/{any?}', function () {
$response = app('tus-server')->serve();
return $response->send();
})->where('any', '.*'); |
Yes true, thanks :) |
Not sure if I should open a new issue, but do have some follow up questions.
|
|
$server
->setApiPath('/tus')
->setUploadDir(storage_path('tus'));
|
Hi @s1rc, I just tried in one of my Laravel's installation and it seems to be working fine. I hope you properly setup your tus endpoint for uppy. const uppy = Uppy.Core({debug: true, autoProceed: false})
.use(Uppy.Dashboard, {target: '#uppyUploader', inline: true})
.use(Uppy.Tus, {endpoint: 'http://your.app/tus'}) // tus endpoint
.run() Note that if you upload same file again while was successfully uploaded previously it won't get uploaded unless you clear your redis or file cache. File cache is saved in Flush your cache first and then try uploading some large files and pause it after a while even if uppy shows 100%. You should see partially uploaded file in your uploads dir. Resume it again and when the upload completes, you should be able to see the complete file. |
I set it up exactly as you wrote the Wiki. I've tried file cache and deleting During upload there are no partially uploaded files in the folder defined at I've tried setting the Laravel environment cache to file and redis, no change. You can see here that pausing and resuming the file just starts over And when a file is at 100% there is a long pause while the file is copied into the folder defined at ``setUploadDir(storage_path('tus'))` |
Hi @s1rc, The progress bar is updated by uppy as soon as the first byte is sent to the server and don't wait for the actual byte to be updated. This process is very quick in local so the progress bar reaches 100% immediately. This won't happen in actual server as there will be lag when sending first byte to the server.
I see that the file is 2.5gb which will take some time to upload (even partially). Try by uploading small file lets say 50 mb. When the progress bar reaches 100%, wait for 2-3 seconds and pause it, there should be partially uploaded file in your uploads dir.
There is long pause because file is now actually being uploaded to the server. Again, this happens only in local because of the way uppy progress bar works. If you have a test server, I recommend you to check on that and things will be clear for you. I know this is confusing but it happens only in local and I haven't found a way to fixed that yet. If you can figure out how to fix it that would be a great help. I will try to check with uppy team later. |
@ankitpokhrel thanks for the feedback. I tested it on a development server on AWS and it does seem to be working better. |
I will try to replicate the issue as soon as I get some time and will get back to you |
Closed in favor of #44 |
Is it possible for this to run on request within a framework, like Laravel?
I want to test this out, however with deployment it would be ideal to have requests handled by our app instead of running a separate server.
The text was updated successfully, but these errors were encountered: