check a file uploaded correctly in php

by Prakash 2013-08-03 16:23:41

To check a form file upload use the following code. It will check whether it is a valid file upload.


<?php
if(isset($_POST['fsubmit']){
if(is_uploaded_file($_FILES['ImageFile']['tmp_name'])){
echo "File upload is valid";
}
else{
echo "File upload is not valid";
}
}
?>
<form action="" method="post">
<input type="file" name="ImageFile" />
<input type="submit" name="fsubmit" value="Submit" />
</form>
444
like
0
dislike
0
mail
flag

You must LOGIN to add comments