I have been trying to upload a video file on a server.
however, when i go to the folder where that file has been uploaded it shows a size of 0 KB. till now i cant find the reason for that,i tired to check out if the problem was from the disk quota but it seems not bcz the same error happened.
Please can anyone help with this.
Thank you.
uploaded file size 0 KB
Moderator: General Moderators
Re: uploaded file size 0 KB
Check "upload_max_filesize" variable in php.ini configuration file and compare it with file size you are uploading, if it is more than configuration variable then it will not upload the file.
Re: uploaded file size 0 KB
Code: Select all
Re: uploaded file size 0 KB
Code: Select all
<?php
$uploaddir4 = "uploads\audiv";
include("configdb.php");
mysql_select_db('upload_site2') or die(mysql_error());
$originame=$_FILES['uploadfile']['name'];
$filename3="$uploaddir4\\$originame";
if (is_uploaded_file($_FILES['uploadfile']["tmp_name"])) {
if($_FILES["uploadfile"]["type"] == "video/x-flv" ){
if (file_exists("$uploaddir4\\$originame")) { //if else see if file exists than rename it instead of overwriting
$random_digit=rand(000000000000,999999999999);
$originame=$random_digit.$originame;
}
else {
$originame = $_FILES['uploadfile']['name'];
}
$target4 = "$uploaddir4\\$originame";
move_uploaded_file($_FILES['uploadfile']["tmp_name"],$target4 ) or die ('Couldn\'t copy');
echo "file was moved!<br/>";
}}