CHANGE_FILE_UPLOAD
This commit is contained in:
parent
69f8243ac0
commit
e45ed19049
@ -773,7 +773,7 @@ class LeadsController extends BaseController
|
||||
|
||||
$multi_file_data = [];
|
||||
foreach ($files as $index => $value) {
|
||||
$file_name = file_Upload_with_random_name($value, $uploadFilePath);
|
||||
$file_name = file_Upload($value, $uploadFilePath);
|
||||
$multi_file_data[] = [
|
||||
'file_name' => $file_name,
|
||||
'docs_name' => $docs_names[$index],
|
||||
@ -2605,6 +2605,7 @@ class LeadsController extends BaseController
|
||||
$this->myLogger->logme('error', (' no file found ' . $file_name_with_path));
|
||||
return ['status' => 'failed', 'message' => 'no file found'];
|
||||
}
|
||||
|
||||
}catch(Exception $e){
|
||||
$this->myLogger->logme("error", "Exception: " . $e->getMessage() . " --- Line: " . $e->getLine() . " --- Trace: " . $e->getTraceAsString());
|
||||
return ['status' => 'fail', 'error' => "File not found / Wrong file"];
|
||||
|
||||
@ -57,21 +57,7 @@ if (!function_exists('file_Upload')) {
|
||||
if ($fileToUpload !== null && $fileToUpload->isValid() && !$fileToUpload->hasMoved()) {
|
||||
$fileToUpload->move($filepath);
|
||||
$fileName = $fileToUpload->getName();
|
||||
$fileName = preg_replace('/[\s\x{00A0}\x{200B}-\x{200D}\x{FEFF}]/u', '', $fileName);
|
||||
return $fileName;
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
// $fileName = preg_replace('/[\s\x{00A0}\x{200B}-\x{200D}\x{FEFF}]/u', '', $fileName);
|
||||
return $fileName;
|
||||
} else {
|
||||
return "";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user