Re: stahovanie rtf a pdf suborov

From: h! y n e k . l i p a (hynek.lipa@worldonline.cz)
Date: 15. 07. 2003, 21:02 CEST


h! y n e k . l i p a wrote:
> musis prohlizeci poslat spravnou hlavicku, treba v PHP nejak
> taktononc:
> <?
>     Header("Content-type: application/octetstream");
>     Header("Location: http://www.example.com/soubor.rtf");
> je to treba vyzkouset, jestli jsem se nekde neupsal:)))
-----------------------------------

vazeni pratele, tak takhle ne. pujde to ale takto:

<?
  $filename="soubor.rtf";

  header("Content-type: application/octetstream");
  header("Content-Disposition: attachment; filename=\"$filename\"");
  header("Content-description: $filename");
  header("Pragma: no-cache");
  header("Expires: 0");
  $fp = FOpen($filename, 'r');
  FPassThru($fp);
  FClose($fp);
?>

trosku jsem se predtim unahlil :(((
ale tady je zase FPassThru coz nekteri admini zakazuji. nicmene tohle
funguje


- h! -
http://www.hyneklipa.cz/



This archive was generated by hypermail 2.1.3 : 15. 07. 2003, 21:03 CEST