Jump to content

Upload file size error??


Boo-urns

Recommended Posts

My script is working great for files under 2mb, anything above it doesn't want to upload and is saying the filesize is 0.

Form information is this:
[code]
<form action="changePictureParse.php" method="post" enctype="multipart/form-data">
<input type="file" name="imagefile"><br />
<input type="submit" name="submit" value="Upload Photo">
[/code]
[code]
//db info

$ok = 1;
$filesize = $_FILES['imagefile']['size'];
echo $filesize;
$maxSize = 2097200;
if ($filesize > $maxSize){
echo "Your file is too large.<br>";
$ok=0;
}

if($ok == 1) {
            //then the rest of uploading the image
[/code]
Link to comment
https://forums.phpfreaks.com/topic/36047-upload-file-size-error/
Share on other sites

Here is what i got when i uploaded a 1.9 MB file the echo is: 1996496

Here is what i got when i tried a 2.9 MB file: 0

Warning: Division by zero in /home/burns/public_html/guru/MyPetwork/changePictureParse.php on line 31

Warning: imagecreatetruecolor(): Invalid image dimensions in /home/burns/public_html/guru/MyPetwork/changePictureParse.php on line 32

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/burns/public_html/guru/MyPetwork/changePictureParse.php on line 36

Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/burns/public_html/guru/MyPetwork/changePictureParse.php on line 40

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/burns/public_html/guru/MyPetwork/changePictureParse.php on line 45

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/burns/public_html/guru/MyPetwork/changePictureParse.php on line 46

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.