Dung Diego

up

......@@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Carbon\Carbon;
use Exception;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Log;
......
......@@ -10,7 +10,8 @@
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.0",
"laravel/sanctum": "^2.14",
"laravel/tinker": "^2.7"
"laravel/tinker": "^2.7",
"league/flysystem-sftp-v3": "^3.33"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
......
......@@ -57,7 +57,16 @@
'driver' => 'local',
'root' => storage_path('ocr'),
],
'ocr_results_sftp' => [
'driver' => 'sftp',
'host' => env('OCR_HOST','172.30.4.104'),
'username' => env('OCR_USERNAME','ubuntu'),
'port' => 22,
'root' => env('OCR_ROOT', '/home/ubuntu/iwa'),
'timeout' => 30,
'privateKey' => env('OCR_KEY'),
'passphrase' => env('OCR_PASSPHRASE', null),
],
],
/*
......
......@@ -17,7 +17,7 @@
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
'default' => env('LOG_CHANNEL', 'daily'),
/*
|--------------------------------------------------------------------------
......
......@@ -46,7 +46,7 @@
if(!file) return;
let formData = new FormData();
formData.append('file', file);
formData.append('attached_file', file);
axios.post("{{route('import_pdf')}}", formData, {
headers:{
......
......@@ -15,4 +15,19 @@
*/
Route::get('/', [OcrController::class,'index']);
Route::get('/test', function () {
$file = 'D:\\key\\id_rsa_oms_base_test.pem';
return response()->json([
'php_sapi' => PHP_SAPI,
'current_user' => get_current_user(),
'script_owner' => getmyuid(),
'cwd' => getcwd(),
'file_exists' => file_exists($file),
'is_readable' => is_readable($file),
'realpath' => realpath($file),
'file_get_contents'=> @file_get_contents($file) !== false ? 'OK' : error_get_last(),
]);
});
Route::post('/import-pdf', [OcrController::class,'import_pdf'])->name('import_pdf');
......