uploaded file size 0 KB

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
pascale
Forum Newbie
Posts: 10
Joined: Wed May 16, 2012 1:40 am

uploaded file size 0 KB

Post 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.
pbs
Forum Contributor
Posts: 230
Joined: Fri Nov 07, 2008 5:31 am
Location: Nashik, India
Contact:

Re: uploaded file size 0 KB

Post 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.
pascale
Forum Newbie
Posts: 10
Joined: Wed May 16, 2012 1:40 am

Re: uploaded file size 0 KB

Post 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
pbs
Forum Contributor
Posts: 230
Joined: Fri Nov 07, 2008 5:31 am
Location: Nashik, India
Contact:

Re: uploaded file size 0 KB

Post by pbs »

Is it possible to post your uploading code in forum
pascale
Forum Newbie
Posts: 10
Joined: Wed May 16, 2012 1:40 am

Re: uploaded file size 0 KB

Post 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.
Post Reply