developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 13 years ago

Closed 13 years ago

#337 closed bug (fixed)

Pb de téléchargement de fichier avec JResponseBinary

Reported by: sylvain261 Owned by: laurentj
Priority: normal Milestone: Jelix 1.0 RC1
Component: jelix:core response Version: 1.0 beta3
Severity: normal Keywords: download IE cache header HTTP
Cc: Blocked By:
Blocking: Documentation needed:
Hosting Provider: Php version:

Description

cf http://fr.php.net/header

If you want to serve files to be opend in a separate application (also PDF files displayed in the Reader and not in the IE Plugin) with the dialog open/save as/cancel : Don't use the Content-disposition: attachmet and Cache-control: no-cache header at same time. Normaly the browser stores the file in a temporary directory and starts the default application for the mime-type with the path of the file as parameter. Problem : IE6 doesn't store because of no-cache. So the application (in my case AcrobatReader?) displays the file can't be found.

=> De plus il ne s'agit pas simplement de ne pas envoyer à la main les header nocache mais de faire en sorte qu'il ne soit pas non plus envoyés par le serveur web.

Je suggère donc de modifier la méthode _downloadHeader de jResponseBinary et de remplacer les lignes

$this->addHttpHeader('Pragma','no-cache', false);
$this->addHttpHeader('Cache-Control','no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false);
$this->addHttpHeader('Expires','0', false);

par

$this->addHttpHeader('Cache-Control', 'maxage=3600', true);
$this->addHttpHeader('Pragma', 'public', true);

On peut également envisager de faire des header HTTP conditionnels en fonction du user agent...

Change History (2)

comment:1 Changed 13 years ago by laurentj

  • Component changed from jelix to jelix:core response
  • Milestone set to Jelix 1.0 RC1
  • Owner set to laurentj

comment:2 Changed 13 years ago by laurentj

  • Resolution set to fixed
  • Status changed from new to closed

Merci pour le patch. Corrigé dans le trunk.

Note: See TracTickets for help on using tickets.