I am having a small issue that would love to get some assistance on, I have a image upload that I am building and would like to move the file to a folder image and copy it to a folder image_thumb also. I am using arrays with keys but when I try to add the copy() function it gives an error saying that it failed to open stream.
It manages to upload the image to image folder, but not the other one, could someone tell me what I did wrong in the copy($key, "image_thumbnail/" . $_FILES['images']['name'][$i]); function.
Thank you for the awesome upcoming assistance :)
Here is my code
<?php
if (isset($_POST['addpart'])) {
$image = $_FILES['images']['tmp_name'];
$i = 0;
foreach ($image as $key) {
move_uploaded_file($key, "image/" . $_FILES['images']['name'][$i]);
copy($key, "image_thumbnail/" . $_FILES['images']['name'][$i]);
$i++;
}
echo 'Uploaded';
echo '<hr>';
}
?>