Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

Problem downloading attachments

Aloittaja ccheaton, joulukuu 03, 2004, 09:34:56 AP

« edellinen - seuraava »

ccheaton

Ok.  I can't do it now, but I'll try tomorrow or sometime soon.

[Unknown]

I can tell you something to change that might fix it, but the problem is it could also break it for other browsers, and wouldn't work exactly the same.

-[Unknown]

ccheaton

Sure...  I could at least give it a shot, I suppose.  I have a test forum that is a mirror of it that I can try it on.  If it breaks, then I'll just change it back.


[Unknown]

Find, Sources/Display.php:

// Send the attachment headers.
header('Pragma: ');
header('Cache-Control: max-age=' . (525600 * 60) . ', private');
if (!$context['browser']['is_gecko'])
header('Content-Transfer-Encoding: binary');
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 525600 * 60) . ' GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime($filename)) . ' GMT');
header('Accept-Ranges: bytes');
header('Set-Cookie:');
header('Connection: close');

if (!isset($_REQUEST['image']))
{
header('Content-Disposition: attachment; filename="' . $real_filename . '"');
header('Content-Type: application/octet-stream');
}


Replace:

// Send the attachment headers.
header('Set-Cookie:');
header('Connection: close');

if (!isset($_REQUEST['image']))
header('Content-Disposition: inline; filename="' . $real_filename . '"');


That should still work.

Also find this:
// This is done to clear any output that was made before now. (would use ob_clean(), but that's PHP 4.2.0+...)
ob_end_clean();
if (!empty($modSettings['enableCompressedOutput']) && @version_compare(PHP_VERSION, '4.2.0') >= 0)
@ob_start('ob_gzhandler');
else
ob_start();


Replace it with:

ob_end_clean();
ob_start();

header('Content-Encoding: none');


-[Unknown]

Louis

Lainaus käyttäjältä: Trekkie101 - joulukuu 04, 2004, 08:59:48 AP
... theres always hope and light at the end of the tunnel...
And how can you be sure it isn't the oncoming train? ;)

No, serious. I've seen the same problem with an IE6 with all latest patches included whereas it works fine on all of my own PCs (IE6+5.5 as well). Really seems to be an issue with some strange Windoze and/or MSIE security (?) settings.

Even the fix [Unknown] suggested did not help at all.
It is your mind that creates this world (Buddha)

Advertisement: