Uploads seem screwey

I allow uploads on my page, everything seems to work (error code is 0) but cant find the uploaded file.
Heres the handler

foreach($images['name'] AS $key => $image_name) {
  if(empty($image_name)) { continue; }
  $ext = strtolower(pathinfo($image_name, PATHINFO_EXTENSION));

  if( (in_array($ext, ['jpg', 'jpeg', 'gif', 'png', 'bmp']) && ($images["size"][$key] < 512000)) ){ 
	  $source = $images['tmp_name'][$key];   
	  $target = $path_to_image_directory . $image_name;
	  $image_type = $images['type'][$key];
	  $image_size = $images['size'][$key];

	  move_uploaded_file($source, $target);
	  
  $message .= '<tr><td>Name</td><td>'.$image_name.'</td><td rowspan="3"><img style="height:100px" src="'.$target.'"></td></tr>';
  $message .= '<tr><td>Type</td><td>'.$image_type.'</td></tr><tr><td>Size</td><td>'.$image_size.'</td></tr>';
  $message .= '</table>';
     }
}

and I get

Warning: move_uploaded_file(…/providers/1/yokishop-logo.jpg): failed to open stream: No such file or directory in /home/luke69/public_html/thanks_provider.php on line 263

Warning: move_uploaded_file(): Unable to move ‘/tmp/phpIDhFZD’ to ‘…/providers/1/yokishop-logo.jpg’ in /home/luke69/public_html/thanks_provider.php on line 263

Warning: move_uploaded_file(…/providers/1/mitchs-logo.jpg): failed to open stream: No such file or directory in /home/luke69/public_html/thanks_provider.php on line 263

Warning: move_uploaded_file(): Unable to move ‘/tmp/phpzuPRC6’ to ‘…/providers/1/mitchs-logo.jpg’ in /home/luke69/public_html/thanks_provider.php on line 263

so its seing my images, but I dont understand the warning

If …/providers/1/yokishop-logo.jpg is relative to /home/luke69/public_html/thanks_provider.php then you are trying to upload to a location outside of your hosting. The root folder of your hosting would be /home/luke69 so you can’t try to put anything outside of that folder.

thank again felgall

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.