Ok that problem is fixed by changing the code as follows, uploads work fine. [code]<?php error_reporting(E_ALL & ~E_NOTICE); $uploaddir = "uploads/"; $filename = trim($_FILES['upfile']['name']); $filename = substr($filename, -15); $filename = ereg_replace(" ", "",$filename); if((ereg(".jpg", $filename)) || (ereg(".gif", $filename))) { $uploadfile = $uploaddir . $filename; if (move_uploaded_file($_FILES['upfile']['tmp_name'], $uploadfile)) { chmod($uploadfile, 0644); print("File upload was successful"); } else { print("File upload failed"); } } else { print("Only images in .gif or .jpg extentions are allowed, upload failed!"); } ?> [/code] But I sure would like to know how to change the filename after submission to something unique so I don't ever end up with two files of the same name with one overwritting the other :-)