$max_filesize) die('The file you attempted to upload is too large.'); // Upload the file to your specified path. $newname = substr(sha1(time().$_POST['filename']) ,0, 10).'.'.$ext; if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $newname)) { echo 'success'; } else { echo 'It has died, unknown O.o'; } mysql_query ("insert_into 'uploads' (path, userid) values ('$uploadedpath', '$userid')") ?>