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
This is a nasty code but It work for me for an AngularJs and Laravel 5 integration. I am just happy and want to share it for sme. It is a copy from one post here but modified.
publicfunctiongetSubirArchivo($declaracion) {
error_log('Documento 22');
$request = new \Flow\Request();
$config = new \Flow\Config(array(
'tempDir' => './chunks_temp', //With write access
));
$file = new \Flow\File($config, $request);
$response = Response::make('', 200);
$destination = './archivos/' . $declaracion . '_' . $request->getFileName();
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
error_log('Documento GET');
if (!$file->checkChunk()) {
error_log('Documento GET2');
return Response::make('', 204);
}
} else {
if ($file->validateChunk()) {
$file->saveChunk();
error_log('Documento VaLido !!!');
} else {
error_log('Documento INVALIDO');
// error, invalid chunk upload request, retryreturn Response::make('Error in chunck', 400);
}
}
if ($file->validateFile() && $file->save($destination)) {
error_log('EXITO!');
$response = Response::make('pass some success message to flow.js', 200);
}
return$response;
}
The text was updated successfully, but these errors were encountered:
@hugomosh we are using the same thing you have here, but with PHP 7, and we are seeing very weird things.
We have nginx in front of our php, using php-fpm, but we noticed that it has to retry a lot of chunks several times before uploading the files... after hours of debugging and testing, we found that if we add a sleep(2); it just works... so, we were wondering, have you experience the same thing? Do you have any clue of what could be the problem?
Thanks @hugomosh... it turned out to be a problem with fpm and permissions... after setting the permissions of the folders you need to restart fpm, otherwise it will not work.
This is a nasty code but It work for me for an AngularJs and Laravel 5 integration. I am just happy and want to share it for sme. It is a copy from one post here but modified.
The text was updated successfully, but these errors were encountered: