Click to See Complete Forum and Search --> : php upload code


c_programmer
02-01-2005, 03:12 PM
I need some php upload code, I have a javascript uploader that makes a reference to upload.php, do you know where I could get that. I can edit php fairly well.

96turnerri
02-01-2005, 03:33 PM
well upload.php could contain any code and it wont be the same upload.php as there as 1000s of files called that in the world, anyway you want something like


if (is_uploaded_file($HTTP_POST_FILES['userfile'])) {
copy($HTTP_POST_FILES['userfile'], "/place/to/put/uploaded/file");
} else {
echo "Possible file upload attack: filename '$HTTP_POST_FILES[userfile]'.";
}

pyro
02-01-2005, 03:52 PM
Read this for more info on handling file uploads with PHP: http://us3.php.net/features.file-upload