www.webdeveloper.com
Results 1 to 6 of 6

Thread: large file upload

  1. #1
    Join Date
    Feb 2006
    Location
    india
    Posts
    678

    large file upload

    Hi Guys,

    I am trying to upload a file which is 4mb in size but the max upload size is 2mb

    I tried with using .htaccess but not working its showing 500 internal server error.

    Anyother ideas please

    thanks

  2. #2
    Join Date
    Jul 2010
    Location
    /ramdisk/
    Posts
    865
    You will need to change this setting inside of php.ini
    This setting can not be changed inside of your php script.

    Here is a brief outline of what you will need to do (on a *NIX host):

    1) find php.ini (*!*possibly called php5.ini)
    # you can use
    # user@host> php -i | fgrep '.ini'
    # or you can make a webpage and put "<?php phpinfo(); ?>" then open it in a browser, its near the top

    2) copy php.ini to your php scripts directory
    # you can use
    # user@host> cp /path/to/php.ini ~webdir/upload/php.ini
    # or you can use an FTP client

    3) open php.ini in your script's directory (with a text editor)
    #
    # upload_max_filesize = xxxM
    # is the directive you want to edi
    # where xxx is an integer and M means megabyte

    4) save it/done

    ---------------
    Tips:
    I find that people have issues around 80MB, at which point you will need to learn more about how uploads work (I don't have timem but it's not exactly clear cut from what I can tell) or force uploaders to compress / split files.


    ---------------
    Notes:
    You may also want to consider changing.

    memory_limit = xxxM
    post_max_size = xxxM
    file_uploads = On | Off

    If you intend to store the files in mysql as a blob, you will likely have to change the max packet size for mysql also.
    Last edited by eval(BadCode); 02-05-2011 at 10:10 PM.

  3. #3
    Join Date
    Feb 2006
    Location
    india
    Posts
    678
    Hi

    Thanks for your suggestion....

    but the problem is that how can I get the php.ini file....the site is hosted in shared server...or shall I request the host to provide the php.ini file?

    thanks once again mate

  4. #4
    Join Date
    Jul 2010
    Location
    /ramdisk/
    Posts
    865
    Derp...

    Rename this file to "php.ini" and add it to your PHP script's directory.
    Attached Files Attached Files
    Last edited by eval(BadCode); 02-06-2011 at 09:12 AM.

  5. #5
    Join Date
    Feb 2006
    Location
    india
    Posts
    678
    Ok let me try this

  6. #6
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,924
    You probably cannot modify the php.ini file on your shared host. Simply creating a local copy will not affect how your PHP scripts run, since PHP is normally invoked by the web server as an Apache module, and the php.ini settings are only applied when the web server in initiated. For that particular setting, the only other option is to change it via a local .htaccess file, and that can only work if your host's Apache configuration both allows personal .htaccess files in general and in specific allows the use of the php_value directive in them. You'll have to check with your hosting admin and/or FAQ if that is the case.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles