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 20d21ce commit 32d8124
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions application/controllers/Inspection.php
Original file line number Diff line number Diff line change
Expand Up @@ -923,25 +923,30 @@ public function photoupload(){

public function imgupload(){

for($i=0;$i < count($_FILES["file"]);$i++)
{



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

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

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

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

Expand Down

0 comments on commit 32d8124

Please sign in to comment.