Hello friends🙂 Sharon here. I have an upload page that goes to a scanin.php script shown below. When I upload a file I get "file is .jpg or whatever I uploaded and then it shows "file not stored". I'm new to this and guessing maybe the file stored path is wrong or maybe a few things are wrong. Please help with the script below🙂))
<?php
$uploadpath = 'www.xxxxxxxx.com/images';
$source = $HTTP_POST_FILES['file1']['tmp_name'];
$dest = '';
if ( ($source != 'none') && ($source != '' )) {
$imagesize = getimagesize($source);
switch ( $imagesize[2] ) {
case 0:
echo '<BR> Image is unknown <BR>';
break;
case 1:
echo '<BR> Image is a GIF <BR>';
$dest = $uploadpath.uniqid('img').'.gif';
break;
case 2:
echo '<BR> Image is a JPG <BR>';
$dest = $uploadpath.uniqid('img').'.jpg';
break;
case 3:
echo '<BR> Image is a PNG <BR>';
$dest = $uploadpath.uniqid('img').'.png';
break;
}
if ( $dest != '' ) {
if ( move_uploaded_file( $source, $dest ) ) {
echo 'File successfully stored.<BR>';
} else {
echo 'File could not be stored.<BR>';
}
}
} else {
echo 'File not supplied, or file too big.<BR>';
}
?>