Page 1 of 1

cant upload above 100kb

Posted: Thu Dec 09, 2010 11:05 am
by inosent
Hi

i have checked the cPanel and it notes:

File Uploads file_uploads On
File Uploads upload_max_filesize 50M

my code is

Code: Select all

<?php
if((!empty($_FILES["uploaded_file"])) && ($_FILES['uploaded_file']['error'] == 0)) {
  $filename = basename($_FILES['uploaded_file']['name']);
  if (($_FILES["uploaded_file"]["size"] < 100000000)) {
      $newname = dirname(__FILE__).'/upload/'.$filename;
      if (!file_exists($newname)) {
        if ((move_uploaded_file($_FILES['uploaded_file']['tmp_name'],$newname))) {
           echo "It's done! The file has been saved as: ".$newname;
        } else {
           echo "Error: A problem occurred during file upload!";
        }
      } else {
         echo "Error: File ".$_FILES["uploaded_file"]["name"]." already exists";
      }
  } else {
     echo "Error: Size limit exceeded";
  }
} else {
 echo "Error: No file uploaded";
}
?>



but no matter what i do to the size section, i cant upload past 100kb

does anyone know how to fix this?

thanks

Re: cant upload above 100kb

Posted: Thu Dec 09, 2010 12:44 pm
by Darhazer
What is the value of $_FILES['uploaded_file']['error'] ?

Re: cant upload above 100kb

Posted: Thu Dec 09, 2010 1:24 pm
by inosent
honestly, i am not sure

i think there is some code in that script that shouldnt be there, related to file type. i dont want any restrictions, file, or file size, just want a simplified script to upload a file of any type and any size to my server, up to, i guess, the 50MB limit, shown in cPanel.

when i upload a file via cPanel, they tell me on that page the file size limit is 22.95 MB, which for my purposes is fine also

i am guessing there is something in the code that is causing the 100kb limit issue because i dont see anything on the servier side creating that limit.

thanks for the reply