FIX_MKDIR implemented for file upload : ps
This commit is contained in:
parent
e868e80046
commit
df825bd66e
@ -141,16 +141,20 @@ class Companycontroller extends BaseController
|
||||
|
||||
if ($PictureName != '') {
|
||||
if ($file !== null && $file->isValid() && !$file->hasMoved()) {
|
||||
$file->move(ROOTPATH.'public/uploads/images/');
|
||||
$Picture = $file->getName();
|
||||
$path = ROOTPATH.'public/uploads/images/';
|
||||
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
||||
$Picture = $file->getName();
|
||||
$file->move($path,$Picture);
|
||||
}else{
|
||||
$Picture = $PictureName;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($file !== null && $file->isValid() && !$file->hasMoved()) {
|
||||
$file->move(ROOTPATH.'public/uploads/images/');
|
||||
$Picture = $file->getName();
|
||||
$path = ROOTPATH.'public/uploads/images/';
|
||||
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
||||
$Picture = $file->getName();
|
||||
$file->move($path,$Picture);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -307,10 +307,10 @@ class Emergencypurchaseorder extends BaseController
|
||||
|
||||
|
||||
if ($file->isValid() && !$file->hasMoved()) {
|
||||
|
||||
$file->move(ROOTPATH.'public/uploads/BillFiles/');
|
||||
$Picture = $file->getName();
|
||||
|
||||
$path = ROOTPATH.'public/uploads/BillFiles/';
|
||||
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
||||
$Picture = $file->getName();
|
||||
$file->move($path,$Picture);
|
||||
}
|
||||
//echo $Picture;
|
||||
$arr[] = array($Picture);
|
||||
@ -788,10 +788,10 @@ class Emergencypurchaseorder extends BaseController
|
||||
|
||||
if ($fcount == 0) {
|
||||
if ($file->isValid() && !$file->hasMoved()) {
|
||||
|
||||
$file->move(ROOTPATH.'public/uploads/BillFiles/');
|
||||
$Picture = $file->getName();
|
||||
|
||||
$path = ROOTPATH.'public/uploads/BillFiles/';
|
||||
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
||||
$Picture = $file->getName();
|
||||
$file->move($path,$Picture);
|
||||
}
|
||||
//echo $Picture;
|
||||
$arr[] = array($Picture);
|
||||
|
||||
@ -231,6 +231,7 @@ class Employeedetails extends BaseController
|
||||
$allowedTypes = ['jpg', 'jpeg', 'png', 'gif'];
|
||||
if (in_array($photo->getExtension(), $allowedTypes)) {
|
||||
$newName = $photo->getRandomName();
|
||||
if(!is_dir($uploadDir)) { mkdir($uploadDir, 0777, true); }
|
||||
$photo->move($uploadDir, $newName);
|
||||
$Picture = $newName;
|
||||
}
|
||||
@ -466,7 +467,7 @@ class Employeedetails extends BaseController
|
||||
if (in_array($photo->getExtension(), $allowedTypes)) {
|
||||
// Generate unique file name
|
||||
$newName = $photo->getRandomName();
|
||||
|
||||
if(!is_dir($uploadDir)) { mkdir($uploadDir, 0777, true); }
|
||||
// Move the uploaded file to the upload directory
|
||||
$photo->move($uploadDir, $newName);
|
||||
|
||||
@ -577,6 +578,7 @@ class Employeedetails extends BaseController
|
||||
$allowedTypes = ['jpg', 'jpeg', 'png', 'gif'];
|
||||
if (in_array($photo->getExtension(), $allowedTypes)) {
|
||||
$newName = $photo->getRandomName();
|
||||
if(!is_dir($uploadDir)) { mkdir($uploadDir, 0777, true); }
|
||||
$photo->move($uploadDir, $newName);
|
||||
$Picture = $newName;
|
||||
}
|
||||
@ -590,6 +592,7 @@ class Employeedetails extends BaseController
|
||||
$allowedTypes = ['jpg', 'jpeg', 'png', 'gif'];
|
||||
if (in_array($photo->getExtension(), $allowedTypes)) {
|
||||
$newName = $photo->getRandomName();
|
||||
if(!is_dir($uploadDir)) { mkdir($uploadDir, 0777, true); }
|
||||
$photo->move($uploadDir, $newName);
|
||||
$Picture = $newName;
|
||||
}
|
||||
|
||||
@ -233,10 +233,10 @@ class Inwardgateregister extends BaseController
|
||||
if (!empty($requestfilename)) {
|
||||
|
||||
if ($file->isValid() && !$file->hasMoved()) {
|
||||
|
||||
$file->move(ROOTPATH.'public/uploads/Igrfiles/');
|
||||
$path = ROOTPATH.'public/uploads/Igrfiles/';
|
||||
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
||||
$Picture = $file->getName();
|
||||
|
||||
$file->move($path, $Picture);
|
||||
}else{
|
||||
$Picture = "";
|
||||
}
|
||||
@ -269,9 +269,11 @@ class Inwardgateregister extends BaseController
|
||||
|
||||
|
||||
if ($newfile->isValid() && !$newfile->hasMoved()) {
|
||||
$path = ROOTPATH . 'public/uploads/Igrfiles/';
|
||||
$newfilename = $newfile->getName();
|
||||
$newfile->move(ROOTPATH . 'public/uploads/Igrfiles/');
|
||||
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
||||
$Picture = str_replace(" ", "", $newfilename);
|
||||
$newfile->move($path,$Picture);
|
||||
} else {
|
||||
$Picture = $oldfile;
|
||||
}
|
||||
@ -331,8 +333,10 @@ class Inwardgateregister extends BaseController
|
||||
|
||||
if ($fcount == 0) {
|
||||
if ($file->isValid() && !$file->hasMoved()) {
|
||||
$file->move(ROOTPATH.'public/uploads/Igrfiles/');
|
||||
$path = ROOTPATH.'public/uploads/Igrfiles/';
|
||||
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
||||
$Picture = $file->getName();
|
||||
$file->move($path,$Picture);
|
||||
}
|
||||
$arr[] = array($Picture);
|
||||
}
|
||||
|
||||
0
public/uploads/spinner.gif
Normal file → Executable file
0
public/uploads/spinner.gif
Normal file → Executable file
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Loading…
Reference in New Issue
Block a user