I cant upload video files using this code for a form:
<form action="upload.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>
and this is upload.php:
<?php
if ($_FILES["file"]["size"] < 2000000000)
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
if (file_exists("videos/" . $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"videos/" . $_FILES["file"]["name"]);
echo "Stored in: " . "videos/" . $_FILES["file"]["name"];
}
}
}
else
{
echo "Invalid file";
}
?>
Though your question is not clear but you can check the following things:
1) Can PHP write to the tempdirectory?
This is where PHP stores the file when it receives it. It will be destroyed
when the script end, so it is your scripts responsibility to MOVE IT OUT
before it ends.
2) Can PHP write to the targetdirectory?
Are you sure PHP has rights to write in the targetdirectory?
also check php.ini . Specially, check
php_value upload_max_filesize 20Mwhether it is meet your uploaded file size or not.