Skip to content

Commit

Permalink
multiple-image
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlosb committed Apr 18, 2024
1 parent 32d8124 commit cb0c944
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions application/controllers/Inspection.php
Original file line number Diff line number Diff line change
Expand Up @@ -926,26 +926,26 @@ public function imgupload(){



for($i=0;$i < count($_FILES["fileupload"]['name']);$i++)
{
//for($i=0;$i < count($_FILES["fileupload"]['name']);$i++)
// {
/* Get the name of the uploaded file */
$filename = str_replace(' ', '_', $_FILES["fileupload"]['name'][$i]);
//$filename = str_replace(' ', '_', $_FILES["fileupload"]['name'][$i]);

/* Choose where to save the uploaded file */
$location = "upload/".$filename;
//$location = "upload/".$filename;

/* Save the uploaded file to the local filesystem */
if ( move_uploaded_file($_FILES["fileupload"]['tmp_name'][$i], $location) ) {
$url[] = 'https://' . $_SERVER['HTTP_HOST'] .'/upload/' . $filename;
}
//if ( move_uploaded_file($_FILES["fileupload"]['tmp_name'][$i], $location) ) {
// $url[] = 'https://' . $_SERVER['HTTP_HOST'] .'/upload/' . $filename;
//}
//$fns[] = $filename;
// }
$response['url'] = $url;
//$response['url'] = $url;
$response['files'] = $_FILES;

echo json_encode($response);
exit;
}
// }
}
public function dynimg($id) {
$pointscore = $this->itindata_model->get_scoreforoutside($id);
Expand Down

0 comments on commit cb0c944

Please sign in to comment.