Basic upload code: <?php // In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead // of $_FILES. $uploaddir = '/var/www/uploads/'; $uploadfile = $uploaddir . basename($_FILES['userfile']['name']); echo '<pre>'; if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\n"; } else { echo "Possible file upload attack!\n"; } echo 'Here is some more debugging info:'; print_r($_FILES); print "</pre>"; ?> Code (markup): PHP.net is a great resource: http://www.php DOT net/features.file-upload HTH
thanks all and btw your this script when i put in it. it dont allow me to upload more than 20 megs of .avi file why isit so ?
You can change this setting, look for 'upload_max_filesize' in your php.ini file http://php.net/manual/en/configuration.php#configuration.file http://php.net/manual/en/ini.core.php#ini.upload-max-filesize HTH, cheers!