TinyPortal

Development => Support => Topic started by: Ray on April 07, 2005, 04:39:26 AM

Title: Only can Download 1.9mg
Post by: Ray on April 07, 2005, 04:39:26 AM
I got a little problem-- if I upload a 30mg file then try to download it will only download 1.9mg -- all the info saids it is the right size even in the folder it will say 30mg -- php.ini is set to 500mg and SMF attachments is also set to really big -- any ideas??
Title: Re: Only can Download 1.9mg
Post by: Bjørn on April 07, 2005, 01:38:40 PM
maybe a option in SMF that limits it...I seem to recall that in the newer versions at least.
Title: Re: Only can Download 1.9mg
Post by: Bjørn on April 07, 2005, 01:41:58 PM
No, I was wrong. Got to have something to do with the server then..but I am clueless there...
Title: Re: Only can Download 1.9mg
Post by: IchBin on April 07, 2005, 02:12:30 PM
Is it just you having this problem Ray, or are others too?
Title: Re: Only can Download 1.9mg
Post by: Ray on April 07, 2005, 03:12:00 PM
IchBin -- others also -- I didnÃÆ'ââ,¬Å¡ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢t think to try to upload from a different location to see if maybe where IÃÆ'ââ,¬Å¡ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢m at is causing the problem.

Note : I host all my own programs

Fixed:
had to make some changes to display.php

In Display.php, find :
Code:

   if (!empty($modSettings['enableCompressedOutput']) && @version_compare(PHP_VERSION, '4.2.0') >= 0)
      @ob_start('ob_gzhandler');
   else


replacing that code with:

Code:

header('Content-Encoding: none');

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

Then find:
Code:

   if (@readfile($filename) === null)
      echo implode('', file($filename));


Replace:
Code:

   if (filesize($filename) > 1024 * 1024)
   {
      @ob_end_clean();
      @ob_end_clean();
      @ob_end_clean();

      $fp = fopen($filename, 'rb');
      while (!feof($fp))
      {
         echo fread($fp, 8192);
         flush();
      }
      fclose($fp);
   }
   elseif (@readfile($filename) === null)
      echo implode('', file($filename));
----------------------------------------------------------------------------------------
Credit goes to -
[Unknown]
Lead Developer
Simple Machines