Comments (19)
message | Server error:
HEAD http://dancenote.test/files/a885eae6a4904422193a8a7584287c2b
resulted in a500 Internal Server Error
response
@alexandrelgy you can find laravel logs in storage/logs
. Please check the logs and try to figure out the issue first. We can't help unless you provide us enough info about the issue.
from tus-php.
Forgot to create it. Directory was missing what a fool.
It seems to work (pause resume and so on).
Really thank you you've been great help !
from tus-php.
Ping @DrudgeRajen
from tus-php.
@alexandrelgy Checked your error.txt file.
"message": "Client error: `SETKEY http://dancenote.test/7e80d1faddb9611c4d82e21eed1bb68d` resulted in a `404 Not Found`
Instead of 405 there is 404 error. Can you please share what you have kept in your Service Provider (to run server) of Laravel? Did you follow this doc properly?
from tus-php.
Yes I did followed this doc ! I might have missed something basic?
Then would 404 come from a route I did not register in a proper way ?
Here is the service provider :
Service Provider
<?php
namespace App\Providers;
use TusPhp\Tus\Server as TusServer;
use Illuminate\Support\ServiceProvider;
class TusServiceProvider extends ServiceProvider
{
// ...
/**
* Register the application services.
*
* @return void
*/
public function register()
{
$this->app->singleton('tus-server', function ($app) {
$server = new TusServer('redis');
$server
->setApiPath('/tus') // tus server endpoint.
->setUploadDir(storage_path('app/public/uploads')); // uploads dir.
return $server;
});
}
// ...
}
from tus-php.
@alexandrelgy Just remove
->setApiPath('/tus') // tus server endpoint.
this line from your service provider.
And from your route remove this
Route::any('/tus/{any?}', function () {
$response = app('tus-server')->serve();
return $response->send();
})->where('any', '.*');
and Replace
$client = new \TusPhp\Tus\Client('http://dancenote.test/tus');
with
$client = new \TusPhp\Tus\Client('http://dancenote.test/');
Let me know if doesn't work.
from tus-php.
It seems like now the verify call does not work neither returning a 500 server error specifying
message | Server error: HEAD http://dancenote.test/files/a885eae6a4904422193a8a7584287c2b
resulted in a 500 Internal Server Error
response
from tus-php.
@alexandrelgy did you add TusServiceProvider
class in config/app.php
? Please check the doc again.
from tus-php.
Sure I did add this App\Providers\TusServiceProvider::class.
I'll check the doc once again and let you know if I did everything right !
@ankitpokhrel I'll also check logs and let you know if I figure out what's wrong.
Thanks for help to you both ! :)
from tus-php.
@alexandrelgy In any case, Could you please share your log file that's generated in storage/logs
folder for the problem you are facing?
from tus-php.
Sure, here it is. I'm going to investigate it today and keep you updated.
from tus-php.
@alexandrelgy After checking your log file, I found that Tus server is not able to connect to Redis Server.
If you don't want to use Redis server for caching then please replace
$server = new TusServer('redis');
with
$server = new TusServer();
In default, Tus server will use file as cache adapter.
from tus-php.
@alexandrelgy As per your provided log file this line
[2018-10-23 06:35:25] local.ERROR: Connection refused [tcp://127.0.0.1:6379] \{"exception":"[object] (Predis\\\\Connection\\\\ConnectionException(code: 61): Connection refused [tcp://127.0.0.1:6379] at /Users/fabrique/code/dancenote/vendor/predis/predis/src/Connection/AbstractConnection.php:155)
states that it was unable to connect to redis server when you tried to make request for the file.
from tus-php.
Nice thanks @samundra & @DrudgeRajen seems to work now !
I've been debugging a few things but i'm facing a response like :
Unable to open /directory/dancenote/storage/app/public/uploads/filnename.file_extension.
I'll investigate it tomorrow but if by any chance someone you have already faced the problem let me know ! :)
from tus-php.
Is your file uploaded successfully to upload directory /directory/dancenote/storage/app/public/uploads/filnename.file_extension
?
from tus-php.
@alexandrelgy For server you had set upload directory as
->setUploadDir(storage_path('app/public/uploads'));
So, please be sure you have uploads
directory at storage/app/public
from tus-php.
I have the same problem. I already follow the instructions on this post, but i'm still in problem
Error:
"message": "Client error:
SETKEY http://dev.bembras.api/75247b51bd97d93cd0094978a29b194e
resulted in a405 Method Not Allowed
UploadController.php
`public function UploadTus()
{
$client = new \GuzzleHttp\Client(['base_uri'=>'http://dev.bembras.api', 'debug'=> true]);
// Alert: Sanitize all inputs properly in production code
if (! empty($_FILES)) {
$fileMeta = $_FILES['tus_file'];
$uploadKey = hash_file('md5', $fileMeta['tmp_name']);
try {
$client->setKey($uploadKey)->file($fileMeta['tmp_name'], time() . '_' . $fileMeta['name']);
$bytesUploaded = $client->upload(5000000); // Chunk of 5 mb
echo json_encode([
'status' => 'uploading',
'bytes_uploaded' => $bytesUploaded,
'upload_key' => $uploadKey
]);
} catch (ConnectionException | FileException | TusException $e) {
echo json_encode([
'status' => 'error',
'bytes_uploaded' => -1,
'upload_key' => '',
'error' => $e->getMessage(),
]);
}
} else {
echo json_encode([
'status' => 'error',
'bytes_uploaded' => -1,
'error' => 'No input!',
]);
}
}`
The Verify method is responding ok, the problem is only on upload.
Sorry for my bad English
from tus-php.
405 errors in Laravel are often linked with csrf security in Laravel.
I added an exception to my VerifyCsrfToken.php and it worked for me.
I do not know if it is or not a bad habit in term of system security for production code, but for local use it seems fine. If the problem does come from here i suggest to add csrf headers in your ajax request.
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
'/verify',
'/tus',
'/tus/*',
'files',
'files/*',
];
}
from tus-php.
@alexandrelgy Really. I add o except and passed, but still with error.
Client error:
POST http://dev.bembras.api/files` resulted in a 404 Not Found
response:\nNo input file specified.\n\n",`
I already put the /files on virtualhost
Also changed the $client = new \GuzzleHttp\Client(['base_uri'=>'http://dev.bembras.api', 'debug'=> true]);
by $client = new \TusPhp\Tus\Client('http://dev.bembras.api');
on Upload Method
from tus-php.
Related Issues (20)
- File based cache - tus_php.server.cache empty - 410 Error HOT 5
- Continue file upload from different browser and device HOT 3
- How to protect single file link? HOT 2
- CakePHP integration does not work HOT 2
- How can I do Cloudflare Integration? HOT 2
- Location header set to http when deployed behind reverse proxy HOT 2
- Unable to upload files - PATCH GONE HOT 1
- Getting Started Documentation
- Allow PHP 8+ for version 1.x.x
- Checksum implementation does not match TUS specification
- Enable to update to PHP 8.1 due to version constraint
- Documentation, Please!
- validating file mime type
- Headers can be totally configurable HOT 1
- Please kindly explain this code to me HOT 1
- Password protected Redis
- Possible bug or configuration issue? HOT 3
- Unable to create resource.
- PHP 8.1+ support HOT 3
- Laravel Octane support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tus-php.