Re: Poskozovani priloh

From: IT Admin <tis (zavinac)>
Date: Thu, 11 Mar 2010 09:22:03 +0100
Díky za skriptík. Vyzkouším a dám vědět.

Rad

Dne 10.3.2010 23:27, Jiri Matejka napsal(a):
> Hoj,
>
> já jsem si na své "download" části udělal tenhle kód. Proměnné si snad
> snadno doupravíš...
>
> $disposition = "attachment";
> if (isset($_SERVER["HTTPS"])):
>         header("Pragma: ");
>         header("Cache-Control: ");
>         header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
>         header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
>         header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
>         header("Cache-Control: post-check=0, pre-check=0", false);
> elseif ($disposition == "attachment"):
>         header("Cache-control: private");
> else:
>         header("Cache-Control: no-cache, must-revalidate");
>         header("Pragma: no-cache");
> endif;
> header("Cache-control: private"); // toto je potreba pro IE v "save as"!!!
> header("Content-Type: $mime");
> header("Content-Disposition:$disposition; filename=\"".trim(htmlentities($name))."\"");
> header("Content-Description: ".trim(htmlentities($name)));
> header("Content-Length: ".(string)(filesize($path)));
> header("Connection: close");
> $fd = fopen($path,'r');
> fpassthru($fd);
> fclose($fd);
>
> DFly
>   
Received on 11. 03. 2010, 09:22 CET

This archive was generated by hypermail 2.2.0 : 11. 03. 2010, 09:22 CET