Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 639681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:52:11+00:00 2026-05-13T20:52:11+00:00

I can’t understand why my server isn’t accepting files larger than 1MB. I am

  • 0

I can’t understand why my server isn’t accepting files larger than 1MB. I am using cpanel and my host has told me that I can’t edit my php.ini file directly.

My upload code:

<?php
if (array_key_exists('uploadfile', $_POST)) {
    $fileName = $_FILES['userfile']['name'];
    $tmpName  = $_FILES['userfile']['tmp_name'];
    $fileSize = $_FILES['userfile']['size'];
    $fileType = $_FILES['userfile']['type'];

    $fp      = fopen($tmpName, 'r');
    $content = fread($fp, filesize($tmpName));
    $content = addslashes($content);
    fclose($fp);

    if (!get_magic_quotes_gpc()) {
        $fileName = addslashes($fileName);
    }

    mysql_query("INSERT INTO tbl_vehiclefiles (`veh_id`,`name`,`type`,`size`,`content`)
VALUES ('$veh_id', '$fileName', '$fileType', '$fileSize','$content')");

    echo '<b>File Upload</b><p>Thank you. The file has been successfully uploaded.

<p><img src="resources/spacer.gif" alt="" width="300px" height="5px" /><p><o>

<i><u>Name:</u>&nbsp;' . $fileName . '<p><i><u>Size:</u>&nbsp;' . $fileSize . 'k' . '<p><u>Type:</u>&nbsp;' . $fileType . '</i><p><p><img src="resources/spacer.gif" alt="" width="300px" height="5px" />';

    $file_id = mysql_insert_id();

    echo "</i><p><a href='managevehicle.php?id=$veh_id' class='form'>Manage details</a><p>
         <a href='viewfile2.php?id=$file_id' class='form'>View details</a><p>";
    exit;
}
?>      

<b>File Upload</b></p>
   <p>
     <input type="hidden" name="MAX_FILE_SIZE" value="200000000">
     <span id="sprytextfield1">
     <input name="userfile" type="file" id="userfile">
    </span><BR />
    <input type="hidden" name="uploadfile" value="1"/> 
    <input name="upload" type="submit" id="upload" value=" Upload ">
   </p>

I was told that I could create my own php.ini file and save it on cpanel file manager to override some of the php.ini values. This is what I have on it at the moment:

//Common local changes:

upload_max_filesize = 20M; // (default 8 - Max, 32)
post_max_size = 20M; // (Average, 20 - Max, 32)
register_globals = Off; // (off by default - you can turn On) 
allow_url_fopen = On; // (off by default - you can turn to On)
memory_limit = 24M; // (default of 8M, Max 32)

but it has no effect! Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T20:52:11+00:00Added an answer on May 13, 2026 at 8:52 pm

    i would start by reading the max upload size with init_get – do this to be sure that your value is being accepted:
    http://php.net/manual/en/function.ini-get.php

    if you want to change the value with your script, you can use init_set:
    http://php.net/manual/en/function.ini-set.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I authenticate with just Google account username and password instead of using OAuth?
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Can you please tell me why there are two log files created on tomcat
Can I have a project that has some parts written in c and other
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Can someone please explain how this code is working for me? I don't understand
Can I access my SkyDrive using a permanent access token? Basically, I want to
Can someone access the database files and/or other files of my app stores in
Can anyone advise on the correct FFT to be using (Real or Complex)? I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.