1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fixed download - out of memory

Discussion in 'Resolved Bug Reports' started by gib, Oct 6, 2010.

  1. gib

    gib Active Member

    I thought I'd try a upload/download test.
    I can upload a largish file ok (98mb), but I get an out of memory error when I try to download the same file.
    I have set the attachment limit to 100mb in the admin options and in a php.ini file on the server.

    When I try to download the file, I get the following memory error.
    Fatal error: Out of memory (allocated 4980736) (tried to allocate 93674624 bytes) in sitedir //library/XenForo/ViewPublic/Attachment/View.php on line 38

    I'm on shared hosting, but the flash uploader seems to have worked ok.
    Is there any way of downloading via another method which doesn't try and load the file into memory first ?
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Not to my knowledge. But you can always ask your host to increase PHP's memory_limit.

    You can also try adding this to your library/config.php file:

    ini_set('memory_limit', '128M');
    Or try adding this to a .htaccess file on your server (only works on Apache servers):

    php_value memory_limit 128M
    gib and Hannah_M like this.
  3. Floris

    Floris Guest

    It won't help. The alpha didn't have it, ever, might just be code going nuts.
  4. gib

    gib Active Member

    Thanks for the suggestion Jake, I've already got a 200mb limit in the php.ini file, but my shared hosting is on either 64 or 128mb.

    Apart from PHPBB3, I've seen other forum software have similar issues (VB4 has same prob, but I can get round it by using the Downloads II addon), so I'm not expecting any easy answers, apart from running on a dedicated server.
    Weird that the flash upload works okay, it's probably doing it in chunks though.

Share This Page