Here's the error I'm getting:
Warning: move_uploaded_file(/home/public_html/img/shuffleboard.jpg): failed to open stream: No such file or directory in /home/solidsns/public_html/uploadpictures.php on line 349
Here's the form section:
<form enctype="multipart/form-data" action="<?=$_SERVER['PHP_SELF']?>" method="post">
<input name="upload1" type="file"><br>
Photo 1 Upload (Max Image File Size 500Kš:<br><br><br>
<input name="upload2" type="file"><br>
Photo 2 Upload (Max Image File Size 500Kš:<br><br><br>
<input name="upload3" type="file"><br>
Photo 3 Upload (Max Image File Size 500Kš:<br><br><br>
<input type="hidden" name="MAX_FILE_SIZE" value="500000">
<input type="submit" name="submit" value="Upload"><br>
</table>
</form>
Here's the code segment to process on submit:
$dest_dir = '/home/solidsns/public_html/img/';
$uploadfile1 = $dest_dir . $_FILES['upload1']['name'];
$uploadfile2 = $dest_dir . $_FILES['upload2']['name'];
$uploadfile3 = $dest_dir . $_FILES['upload3']['name'];
if (isset($_FILES['upload1']))
{
if ($_FILES['upload1']['size'] > "500000")
{
error('File upload failed! File size greater than 500 KB');
}
else
{
move_uploaded_file($_FILES['upload1']['tmp_name'], $uploadfile1);
} // End of File Size Check
} // End if isset file uploaded
There are three uploads: upload1, upload2, and upload3
I've searched plenty of problem records on the site, have RTFM till I'm blue, and have tried so many different ways and still no success. What am I doing wrong?
I'd appreciate any help you can provide. Thanks.