Page 1 of 1

MAX_FILE_SIZE

Posted: Fri Jul 28, 2006 4:05 pm
by toughguy
Hey there,

I'm trying to write a program to upload pictures and other content. It works fine right now (still have to add a couple minor things) unless I try to upload a file larger than 1MB. I don't think it's the MAX_FILE_SIZE part of the equation. Is there something else I have to configure to let me do this?

Thanks in advance!

PART OF THE CODE CAUSING THE ERROR WHEN UPLOADING A FILE LARGER THAN 1MB

$fileuploadname = basename($_FILES['fileName']['name']);
$thumbnailuploadname = basename($_FILES['thumbnail']['name']);

$sql = "INSERT INTO Games (fileName,thumbnail,title,description,category,createDate,votes,score,rating,views)
VALUES ('$fileuploadname','$thumbnailuploadname','$title','$description','$category','$createDate','0','0','0','0')";
mysql_query($sql)
or die ("didn't work");

/* UPLOAD GAME */
$sql = "SELECT * FROM $content WHERE fileName='$fileuploadname'";
$result = mysql_query($sql)
or die ("Couldn't execute query.");
$row = mysql_fetch_array($result);
extract($row);
$fileuploadname = $ID.$fileuploadname;
$uploaddir = "/hsphere/local/home/toughguy/office-wars.com/images/$content/";
$uploadfile = $uploaddir . $fileuploadname;
move_uploaded_file($_FILES['fileName']['tmp_name'], $uploadfile);


AND THE ERROR CODE I GET


Warning: getimagesize(/hsphere/local/home/toughguy/office-wars.com/images/Games/393footninja2.swf): failed to open stream: No such file or directory in /hsphere/local/home/toughguy/office-wars.com/postcontent.php on line 140

Warning: Division by zero in /hsphere/local/home/toughguy/office-wars.com/postcontent.php on line 141

Warning: Division by zero in /hsphere/local/home/toughguy/office-wars.com/postcontent.php on line 142

Warning: getimagesize(/hsphere/local/home/toughguy/office-wars.com/images/Games/393footninja2.swf): failed to open stream: No such file or directory in /hsphere/local/home/toughguy/office-wars.com/postcontent.php on line 166

Warning: Division by zero in /hsphere/local/home/toughguy/office-wars.com/postcontent.php on line 167

Warning: Division by zero in /hsphere/local/home/toughguy/office-wars.com/postcontent.php on line 168

Warning: Cannot modify header information - headers already sent by (output started at /hsphere/local/home/toughguy/office-wars.com/postcontent.php:140) in /hsphere/local/home/toughguy/office-wars.com/postcontent.php on line 304


the division by zero thing is not the problem. It is supposed to get the width and height of the file so it can be resized, but since the file wasn't uploaded it's not working.

Posted: Fri Jul 28, 2006 5:06 pm
by Ollie Saunders
Correct your post to use

Code: Select all

and

Code: Select all

tags.
Then I'll help you out.