I need to do a file upload for videos. i am able to upload the videos with php but i need a way to display the file uploading progress with php and when its 100% uploaded i should display the success message.
File uploading is currently done with ajax.
The issue is, i tried with is_uploaded_file method but this code runs before file is being upload and always it returns false. http://us1.php.net/is_uploaded_file
Should i used any background process ?
<?php
if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
echo "File ". $_FILES['userfile']['name'] ." uploaded successfully.\n";
echo "Displaying contents\n";
readfile($_FILES['userfile']['tmp_name']);
} else {
echo "Possible file upload attack: ";
echo "filename '". $_FILES['userfile']['tmp_name'] . "'.";
}
?>
move_uploaded_file()
instead. – Funk Forty Niner