Uploading Large Files

You have a new message from harcha24. It reads:
From readin your profile I saw that you were way into elgg and kinda into
the bass.  I'm the opposite.  I just got started with elgg but have been
a music instructor for years.  I was hoping to pick your brain for a
second.  I am attempting to use my elgg for musician purposes but can't
seem to get elgg to allow me to upload large files (very large).   I
tried changing the .htaccess file but it dosen't seem to change anything.
could you help?
also I would be interested in any ideas you've come across to implament
more music file control in elgg or other application?

-------------------------------------------------------

  • (1)    Please do not message me asking for help
  • (2)    Post requests for help to the group here.

File upload size is controlled from php.ini

 

 

 

  • Cool well thanks for the help.  as soon as I feel confident with my site I'll have ya add it to your list.

  • OKI

    Dm / / /    Dm / / /    Am7 / / /    Dm / / /

    LOL ;-)

     

     

  • alright I'm just floundering here.  I tried the php.info and read it and it said I could only upload 7mb.  but it seems I can't do that .  my .htaccess file says I can only upload 5mb. and then some folks tell me ait's a php.ini thing.  but I don't seem to have a php.ini file.  at least not one that is accessable to me. I guess I'm a little overwhelmed and not sure where to start.

    in conjunction with this my aaudio player and my music player both won't acknowledge the file and show nothing.  I am assuming that these two problems are related.  maybe I did something to my .htaccess file. idunno.  but I am very desperate here and at a stand still and I hate standing still.  so any help would be greatly appreciated.

  • htaccess code will feed the value to php.ini data "dynamically"

    try this (for example) code inside the .htaccess file

    • php_value upload_max_filesize 50M
    • php_value max_execution_time 300
    • php_value max_input_time 300

    it does not matter that you "don't have a php.ini file" ;-) it is there "somewhere" even if you can't see it and/or your host by default did not create for your domain.

    but a word of warning - if you have a "cheap" hosting like i have.. you host might get cranky if you hog the server's execution time and/or other resources..

    if you can get past the upload size issue... then we look at the audio player...;-)

  • I don't know if this is to much code but I've seen other folks post some up here.  I can delete it after.  as you can see I've attempted to change a little of it.  but am still very confused. if you get a chance maybe you can take a look at it.

     

    # Elgg htaccess directives
    # Copyright Curverider Ltd 2008-2009
    # License http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
    # Link http://elgg.org/

    <IfModule !mod_rewrite.c>
        # ugly ugly hack to detect missing mod_rewrite
        # RedirectMatch must be to an absolute destination, so forces 500 error...
        ErrorDocument 500 "Elgg error: Apache does not have mod_rewrite loaded. Please check your Apache setup."
        RedirectMatch 302 .* index.php
    </IfModule>

    <Files "htaccess_dist">
        order allow,deny
        deny from all
    </Files>

    # Don't listing directory
    Options -Indexes

    # Follow symbolic links
    Options +FollowSymLinks

    # Default handler
    DirectoryIndex index.php

    # Turn on expiry
    <IfModule mod_expires.c>
        ExpiresActive On
        ExpiresDefault "access plus 10 years"
    </IfModule>

    # php 4, apache 1.x
    <IfModule mod_php4.c>
        ErrorDocument 500 "Elgg error: Elgg does not support PHP 4."
        RedirectMatch 302 .* index.php
    </IfModule>

    # php 4, apache 2
    <IfModule sapi_apache2.c>
        ErrorDocument 500 "Elgg error: Elgg does not support PHP 4."
        RedirectMatch 302 .* index.php
    </IfModule>

    # php 5, apache 1 and 2
    <IfModule mod_php5.c>
        # default memory limit to 64Mb
        php_value memory_limit 64M
        # to make sure register global is off
        php_value register_globals 0
        # max post size to 20Mb
        php_value post_max_size 20,971,520
        # upload size limit to 20Mb   
        php_value upload_max_filesize 20,971,520
        # hide errors, enable only if debug enabled
        php_value display_errors 0
    </IfModule>

    # Turn on mod_gzip if available
    <IfModule mod_gzip.c>
        mod_gzip_on yes
        mod_gzip_dechunk yes
        mod_gzip_keep_workfiles No
        mod_gzip_minimum_file_size 1000
        mod_gzip_maximum_file_size 1000000
        mod_gzip_maximum_inmem_size 1000000
        mod_gzip_item_include mime ^text/.*
        mod_gzip_item_include mime ^application/javascript$
        mod_gzip_item_include mime ^application/x-javascript$
        # Exclude old browsers and images since IE has trouble with this
        mod_gzip_item_exclude reqheader "User-Agent: .*Mozilla/4\..*\["
        mod_gzip_item_exclude mime ^image/.*
    </IfModule>

    ## Apache2 deflate support if available
    ##
    ## Important note: mod_headers is required for correct functioning across proxies.
    ##
    <IfModule mod_deflate.c>
        AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript
        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.[0678] no-gzip
        BrowserMatch \bMSIE !no-gzip

    <IfModule mod_headers.c>   
        Header append Vary User-Agent env=!dont-vary
    </IfModule>   
       
        # The following is to disable compression for actions. The reason being is that these
        # may offer direct downloads which (since the initial request comes in as text/html and headers
        # get changed in the script) get double compressed and become unusable when downloaded by IE.
        SetEnvIfNoCase Request_URI action\/* no-gzip dont-vary
        SetEnvIfNoCase Request_URI actions\/* no-gzip dont-vary
       
    </IfModule>

    # Configure ETags
    <FilesMatch "\.(jpg|jpeg|gif|png|mp3|flv|mov|avi|3pg|html|htm|swf)$">
        FileETag MTime Size
    </FilesMatch>

    <IfModule mod_rewrite.c>

    RewriteEngine on

    # If Elgg is in a subdirectory on your site, you might need to add a RewriteBase line
    # containing the path from your site root to elgg's root. e.g. If your site is
    # http://example.com/ and Elgg is in http://example.com/sites/elgg/, you might need
    #
    #RewriteBase /sites/elgg/
    #
    # here, only without the # in front.
    #
    # If you're not running Elgg in a subdirectory on your site, but still getting lots
    # of 404 errors beyond the front page, you could instead try:
    #
    #RewriteBase /

    RewriteRule ^action\/([A-Za-z\_\-\/]+)$ engine/handlers/action_handler.php?action=$1

    RewriteRule ^export\/([A-Za-z]+)\/([0-9]+)$ services/export/handler.php?view=$1&guid=$2
    RewriteRule ^export\/([A-Za-z]+)\/([0-9]+)\/$ services/export/handler.php?view=$1&guid=$2
    RewriteRule ^export\/([A-Za-z]+)\/([0-9]+)\/([A-Za-z]+)\/([A-Za-z0-9\_]+)\/$ services/export/handler.php?view=$1&guid=$2&type=$3&idname=$4

    RewriteRule ^\_css\/css\.css$ _css/css.php

    RewriteRule ^pg\/([A-Za-z0-9\_\-]+)\/(.*)$ engine/handlers/pagehandler.php?handler=$1&page=$2
    RewriteRule ^pg\/([A-Za-z0-9\_\-]+)$ engine/handlers/pagehandler.php?handler=$1

    RewriteRule xml-rpc.php engine/handlers/xml-rpc_handler.php
    RewriteRule mt/mt-xmlrpc.cgi engine/handlers/xml-rpc_handler.php

    RewriteRule ^tag/(.+)/?$ engine/handlers/pagehandler.php?handler=search&page=$1

    </IfModule>

  • # php 5, apache 1 and 2
    <IfModule mod_php5.c>
    #    default memory limit to 64Mb
    php_value memory_limit 64M
    #    to make sure register global is off
    php_value register_globals 0
    #    max post size to 20Mb
    php_value post_max_size 20M
    #    upload size limit to 20Mb   
    php_value upload_max_filesize 20M
    </IfModule>

    should work... I can only say from reading the code.. but you have to test this and see...

    if does not work, play around with increasing the numbers.

    Also ask your Host's Tech Support for advice. They might just be able to give some quick answers because they should their own server setup better than we do ;-)

     

  • So here's what happened.  I uploaded a small MP3 (889kb) it uploaded and plays fine in the zaudio player but not in the aaudio

    then I tried to upload a larger MP3 (12mb) and on my file list it just says my user name and no other info (like the title of the file) and when I try to download it to check it out it says 0 bytes... no file basically.

    any ideas?  should I get more info?

  • I can upload larger files (at least 100mb or so) with the Vanilla forums plugin, which will need a few php_value tweaks as listed in the posts above.

    Here's what I did on my shared host site, but it may be a bit different for you.

    I created a php.ini file on my pc in notepad, adding the following 5 lines
       upload_max_filesize = 300M
       post_max_size = 300m
       set_time_limit = 300
       max_execution_time = 300
       max_input_time = 300

    I then uploaded the php.ini file to the root of my Elgg installation (/public_html/elgg) and I was able to upload 25mb files in Elgg and at least 100mb files in Vanilla forums.
    I also copied the php.ini to the vanilla forums dir, I'll check later if it's actually needed there or not.

  • @Gib thx ;-)

    I kinda totally forgot !!

    the root php.ini

    this might be H's issue

     

  • I tried it.  I seem to be getting the same results as described before. but both the .ini and .htaccess are pretty new to me. other then a 301 redirect I don't think I've ever really gotton one of these to work for me. so I'll try to add as much info as I know how to give which is only the ifo I had before and then I tred upload an info.php file into the root and it told me this about uploads

    uploads is ON

    max file size 7mb

    upload temp directory no value

    I just searched the word "upload" on the file.  I'm not sure if there is something else I should be looking at. thanks for your guys help.  I hope this info helps ya help me. :D