not sure if corrupted is the right term, but my upload copies the file to a folder as well as copying a thumbnail version to a thumbnail folder. the upload works fine (well, as far as getting it on the server) and i can see the files on the server. but when i load them into my gallery i just get X’s. their image properties in the browser show the correct file path to where they reside but the TYPE property is blank for both uploaded files – for some reason its not recognizing them as actual jpgs…
anyone ideas? here is a code snippet that does all the work.
[CODE]
if(isset( $_POST[‘Submit’] )) {
$badfile=$_FILES[‘imagefile’][‘name’];
$file=preg_replace(‘/ /’,’_’,$badfile); // removes spaces
$filetype=substr($file,-4);
$upic = “../images/gallery/$dest_fldr/”.$_FILES[‘imagefile’][‘name’];
$self = $_SERVER[‘PHP_SELF’];
$remove_ext = split(‘.’,$file);
$tmb_file = $remove_ext[0].”_tmb.jpg”;
if (!file_exists($upic)) {
if($filetype==”.jpg”){
copy ($_FILES[‘imagefile’][‘tmp_name’], “../images/gallery/$dest_fldr/”.$_FILES[‘imagefile’][‘name’]) or die (“Could not copy”);
copy ($_FILES[‘imagefile’][‘tmp_name’], “../images/gallery/”.$dest_fldr.”_tmb/”.$tmb_file) or die (“Could not copy”);
}
}
}
thanks!