Page 1 of 1

uploaded file size 0 KB

Posted: Wed May 16, 2012 1:45 am
by pascale
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.

Re: uploaded file size 0 KB

Posted: Wed May 16, 2012 2:15 am
by pbs
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

Posted: Wed May 16, 2012 2:31 am
by pascale
i've already changed the upload_max_filesize and i even tried to upload a really small video.in my code i can upload images,audios,pdfs,etc.just when uploading video file i get this error no matter what the size is

Re: uploaded file size 0 KB

Posted: Wed May 16, 2012 2:46 am
by pbs
Is it possible to post your uploading code in forum

Re: uploaded file size 0 KB

Posted: Wed May 16, 2012 3:49 am
by pascale

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/>";
		
	}}
That is the code.