Update: 2026-05-04 01:59:47
This commit is contained in:
@@ -36,12 +36,17 @@ if (!$stmt->fetch()) {
|
||||
|
||||
// 4. Handle File Upload
|
||||
$dateFolder = date('Y-m-d');
|
||||
$uploadDir = STORAGE_PATH . '/invoices/' . $tenantId . '/' . $companyId . '/' . $dateFolder . '/';
|
||||
$baseInvoicesDir = STORAGE_PATH . '/invoices';
|
||||
if (!is_dir($baseInvoicesDir)) {
|
||||
mkdir($baseInvoicesDir, 0777, true);
|
||||
}
|
||||
|
||||
$uploadDir = $baseInvoicesDir . '/' . $tenantId . '/' . $companyId . '/' . $dateFolder . '/';
|
||||
|
||||
if (!is_dir($uploadDir)) {
|
||||
if (!mkdir($uploadDir, 0777, true)) {
|
||||
error_log("UPLOAD ERROR: Failed to create directory: " . $uploadDir);
|
||||
json_error('فشل في إنشاء مجلد التخزين', 500);
|
||||
json_error('فشل في إنشاء مجلد التخزين: ' . $uploadDir, 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user