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

Options
  • 19-06-2005 6:03pm
    #1
    Registered Users Posts: 2,932 ✭✭✭


    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 Posts: 9,190 ✭✭✭RobertFoster


    Have you got the hidden field before the upload field?


  • Registered Users Posts: 7,739 ✭✭✭mneylon


    Obvious question, but have you restarted apache?


  • Registered Users Posts: 2,932 ✭✭✭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 Posts: 7,739 ✭✭✭mneylon


    Ask your hosting company to help you


  • Registered Users 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 Posts: 7,739 ✭✭✭mneylon


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


  • Registered Users 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 Posts: 2,932 ✭✭✭Sniipe


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


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


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


  • Registered Users Posts: 2,932 ✭✭✭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