Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

PHP upload - max file size

  • 19-06-2005 06:03PM
    #1
    Registered Users, Registered Users 2 Posts: 2,933 ✭✭✭


    I want to upload files about 20 meg or bigger onto my server using PHP. I have the upload working but cannot get large files uploaded.

    In the html form I have
    <input type="hidden" name="MAX_FILE_SIZE" value="20000" />
    

    In the php.ini file on the server I have
    upload_max_filesize = 20M
    
    and
    post_max_size = 20M
    
    and
    memory_limit = 128M
    

    Is there something else I'm missing?
    I get an error code of 2 which tells me there is a problem with MAX_FILE_SIZE.

    Any help would be great. Thanks.


Comments

  • Registered Users, Registered Users 2 Posts: 9,419 ✭✭✭RobertFoster


    Have you got the hidden field before the upload field?


  • Registered Users, Registered Users 2 Posts: 7,741 ✭✭✭mneylon


    Obvious question, but have you restarted apache?


  • Registered Users, Registered Users 2 Posts: 2,933 ✭✭✭Sniipe


    <form enctype="multipart/form-data" action="upload.php" method="POST">
           <input type="hidden" name="MAX_FILE_SIZE" value="200000" />
            Upload: <input name="userfile" type="file" />
        <input type="submit" value="Send File" />
    </form>
    

    And I've restarted apache :(

    Still no joy.


  • Registered Users, Registered Users 2 Posts: 7,741 ✭✭✭mneylon


    Ask your hosting company to help you


  • Registered Users, Registered Users 2 Posts: 4,003 ✭✭✭rsynnott


    You may want to up your max_Execution_time. It's also possible for Apache to limit this, as far as I know; have a look at your conf file.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 7,741 ✭✭✭mneylon


    True.
    If you up the error reporting to something more verbose it might give you more useful information.


  • Registered Users, Registered Users 2 Posts: 1,268 ✭✭✭hostyle


    Sniipe wrote:
    <input type="hidden" name="MAX_FILE_SIZE" value="20000" />
    

    Thats 20,000 bytes.

    http://ie2.php.net/features.file-upload

    The error message you are getting is entirely correct.


  • Registered Users, Registered Users 2 Posts: 2,933 ✭✭✭Sniipe


    Thank you so much hostyle. For some reason I thought it was KB. That did the job. Thanks again.


  • Registered Users, Registered Users 2 Posts: 4,003 ✭✭✭rsynnott


    Unless your users all have unreasonably fast internet connections you should probably still raise the execution time...


  • Registered Users, Registered Users 2 Posts: 2,933 ✭✭✭Sniipe


    thanks rsynnott,
    I'm just playing around with PHP on localhost. I wanted to be able to do upload properly. Thanks 4 the help all. I'll keep max_Execution_time in mind tho.


  • Advertisement
Advertisement