Jump to content


File Upload


3 replies to this topic

#1 Koncept

    Young Padawan

  • Members
  • Pip
  • 41 posts

Posted 09 October 2006 - 01:15 AM

When I go to upload a file of 20mb I get no error or anything, it just does not even try to upload. The $_FILES array is empty. When I upload smaller files everything works fine.

<?php

ini_set('max_execution_time', 9999999999);
ini_set('upload_max_filesize', 9999999999);
ini_set('post_max_size', 9999999999);

$id = rand(1,9999999999);
$root = 'C:/Server/htdocs/';
$uploaddir = $root . 'tmp/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
$flvfile = $root . 'flv/'. $id .'.flv';

if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
	exec('C:/Server/mplayer/mencoder.exe '. $uploadfile .'  -ofps 25 -o '. $flvfile .' -of lavf -oac mp3lame -lameopts abr:br=64 -srate 22050 -ovc lavc -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -lavcopts vcodec=flv:keyint=50:vbitrate=300:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -vop scale=320:240', $out[0]);
	if(file_exists($flvfile)) {
		exec('C:/Server/flvtools/flvtool2.exe -UP ' . $flvfile, $out[1]);
	}
	unlink($uploadfile);
	//echo '<pre>'; print_r($out); echo '</pre>'; die();
	header("Location: index.php?id=$id");
} else {
	echo "Error Uploading File - {$_FILES['userfile']['name']}. <br /> ERROR: #" . $_FILES['userfile']['error'];
}

?>


also when I upload a 20mb file i get
Error Uploading File - .
ERROR:

if i where to print_r($_FILES); i get Array()

:( ?

Edited by Koncept, 09 October 2006 - 08:08 AM.


#2 Koncept

    Young Padawan

  • Members
  • Pip
  • 41 posts

Posted 10 October 2006 - 11:34 AM

nobody has any ideas why this is?

#3 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 10 October 2006 - 09:10 PM

At what point in the script are you using the print_r() function? I'm not all that familiar with using the $_FILES superglobal, as I don't like dealing with file upload scripts much, but for my sense I would believe the actual file is taken out of the array and placed on the server or soemthing?
I'm way off on that, lol, wait for rc to come in and quote from the PHP Bible. :mellow:

Can't really help you on the rest of the script, as I'm not familiar with Linux command prompt execution functions at all.
I would first look and make sure you are submitting to the script with a 'file' input type, and all the basics like trying to print_r() the $_FILES array at the very beginning of the script to make sure its coming like it should.
Then I would check with my host if that fails, make sure I have access to the ini_set() function and such like that.

#4 Koncept

    Young Padawan

  • Members
  • Pip
  • 41 posts

Posted 10 October 2006 - 11:18 PM

View PostDemonslay, on Oct 10 2006, 09:10 PM, said:

At what point in the script are you using the print_r() function? I'm not all that familiar with using the $_FILES superglobal, as I don't like dealing with file upload scripts much, but for my sense I would believe the actual file is taken out of the array and placed on the server or soemthing?
I'm way off on that, lol, wait for rc to come in and quote from the PHP Bible. :)

Can't really help you on the rest of the script, as I'm not familiar with Linux command prompt execution functions at all.
I would first look and make sure you are submitting to the script with a 'file' input type, and all the basics like trying to print_r() the $_FILES array at the very beginning of the script to make sure its coming like it should.
Then I would check with my host if that fails, make sure I have access to the ini_set() function and such like that.


Problem Solved Posted Image - post_max_size needed to be updated from 99999999 to 999M.

Edited by Koncept, 10 October 2006 - 11:19 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users