Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.