File uploads with PHP

Discussion in 'Programming/Scripts' started by steve, May 30, 2005.

  1. steve

    steve New Member

    I've written a PHP script for uploading files to a server. It's working fine except for large files. The limit seems to be 2 MB. Whenever a file is larger the upload fails. Is there some kind of setting I have to change?

  2. roland

    roland New Member

    Have a look at your php.ini and change the line

    upload_max_filesize = 2M
    to a larger value (e.g. 10M for 10 MB) and restart your Apache afterwards.

  3. Lord_Garfield

    Lord_Garfield New Member


    it is true that you can change it in php.ini but still I don't recomand it becouse if you let people upload 10MB they will have to wait a long time. + you will probably also need to change your script time out stuff in php.ini. Don't know exactly what and where but I know you need to change something else to.
    Something that defines how long a script can run. else you get a time exceeded error.
  4. denebstar

    denebstar New Member

    I am interrested to know the conclusion because I have set very large values on my server, I want to be able to upload/download files up to 100M and when I try to so so from the server itself it works (I tried up to 41Mo) but as soon as I tried from another location it fails for files as small as 1M !!

    with the following error :

    Network Error (tcp_error)

    A communication error occurred: ""
    The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.

    For assistance, contact your network support team.
  5. falko

    falko Super Moderator Howtoforge Staff

    Any errors in your logs?

Share This Page