FIX_
This commit is contained in:
parent
7c16c90d14
commit
69f8243ac0
@ -773,7 +773,7 @@ class LeadsController extends BaseController
|
|||||||
|
|
||||||
$multi_file_data = [];
|
$multi_file_data = [];
|
||||||
foreach ($files as $index => $value) {
|
foreach ($files as $index => $value) {
|
||||||
$file_name = file_Upload($value, $uploadFilePath);
|
$file_name = file_Upload_with_random_name($value, $uploadFilePath);
|
||||||
$multi_file_data[] = [
|
$multi_file_data[] = [
|
||||||
'file_name' => $file_name,
|
'file_name' => $file_name,
|
||||||
'docs_name' => $docs_names[$index],
|
'docs_name' => $docs_names[$index],
|
||||||
@ -2605,7 +2605,6 @@ class LeadsController extends BaseController
|
|||||||
$this->myLogger->logme('error', (' no file found ' . $file_name_with_path));
|
$this->myLogger->logme('error', (' no file found ' . $file_name_with_path));
|
||||||
return ['status' => 'failed', 'message' => 'no file found'];
|
return ['status' => 'failed', 'message' => 'no file found'];
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch(Exception $e){
|
}catch(Exception $e){
|
||||||
$this->myLogger->logme("error", "Exception: " . $e->getMessage() . " --- Line: " . $e->getLine() . " --- Trace: " . $e->getTraceAsString());
|
$this->myLogger->logme("error", "Exception: " . $e->getMessage() . " --- Line: " . $e->getLine() . " --- Trace: " . $e->getTraceAsString());
|
||||||
return ['status' => 'fail', 'error' => "File not found / Wrong file"];
|
return ['status' => 'fail', 'error' => "File not found / Wrong file"];
|
||||||
@ -5268,10 +5267,10 @@ class LeadsController extends BaseController
|
|||||||
'filePath' => $fullPath
|
'filePath' => $fullPath
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
log_message('warning', 'File name is empty for ID: ' . $id);
|
log_message('error', 'File name is empty for ID: ' . $id);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log_message('warning', 'File does not exist at path: ' . $fullPath);
|
log_message('error', 'File does not exist at path: ' . $fullPath);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log_message('warning', 'No active lead file found for ID: ' . $id . ' and lead_id: ' . $lead_id);
|
log_message('warning', 'No active lead file found for ID: ' . $id . ' and lead_id: ' . $lead_id);
|
||||||
|
|||||||
@ -65,6 +65,20 @@ if (!function_exists('file_Upload')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!function_exists('file_Upload_with_random_name')) {
|
||||||
|
function file_Upload_with_random_name($fileToUpload, $filepath)
|
||||||
|
{
|
||||||
|
if ($fileToUpload !== null && $fileToUpload->isValid() && !$fileToUpload->hasMoved()) {
|
||||||
|
$fileToUpload->move($filepath);
|
||||||
|
$fileName = $fileToUpload->getRandomName();
|
||||||
|
$fileName = preg_replace('/[\s\x{00A0}\x{200B}-\x{200D}\x{FEFF}]/u', '', $fileName);
|
||||||
|
return $fileName;
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// if (!function_exists('multi_file_Upload')) {
|
// if (!function_exists('multi_file_Upload')) {
|
||||||
// function multi_file_Upload($fileToUpload, $filepath)
|
// function multi_file_Upload($fileToUpload, $filepath)
|
||||||
// {
|
// {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user