Update readFiles method in SapFileController to enhance error reporting and adjust file path
This commit is contained in:
@@ -30,23 +30,23 @@ class SapFileController extends Controller
|
||||
public function readFiles()
|
||||
{
|
||||
|
||||
$path = "/srv/pds.iotsignin.com/sapftp/In/";
|
||||
$path = "/srv/pds.iotsignin.com/www/out/";
|
||||
|
||||
$isDir = is_dir($path);
|
||||
$isReadable = is_readable($path);
|
||||
$isDir = is_dir($path);
|
||||
$isReadable = is_readable($path);
|
||||
|
||||
if (!$isDir || !$isReadable) {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'message' => 'Folder not accessible',
|
||||
'debug' => [
|
||||
'path_checked' => $path,
|
||||
'is_dir' => $isDir,
|
||||
'is_readable' => $isReadable,
|
||||
'php_user' => get_current_user(),
|
||||
]
|
||||
], 500);
|
||||
}
|
||||
if (!$isDir || !$isReadable) {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'message' => 'Folder not accessible',
|
||||
'debug' => [
|
||||
'path_checked' => $path,
|
||||
'is_dir' => $isDir,
|
||||
'is_readable' => $isReadable,
|
||||
'php_user' => get_current_user(),
|
||||
]
|
||||
], 500);
|
||||
}
|
||||
|
||||
// Scan folder
|
||||
$allFiles = scandir($path);
|
||||
|
||||
Reference in New Issue
Block a user