ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-france
php-france
[php-france] download de fichiers
by Claude C. other posts by this author
Jun 19 2006 5:38AM messages near this date
[php-france] HS : équivalent phpDoc pour SQL | Re: [php-france] download de fichiers
Bonjour,

J'ai un problème avec Internet Explorer pour forcer le téléchargement
d'un fichier que je génère à la volée.

Contexte :
Soit un formulaire HTML "index.html" sur lequel de rentre des
identifiants. Le formulaire lancer la page "monFichierConfig.php" qui
génère un fichier de configuration personnalisé pour une application.
Je tente de télécharger ce fichier de configuration que je génère en PHP.
Tout cela fonctionne impeccable avec Firefox. Sous IE, c'est impossible :
Premier message : "Some files can harm your computer... File name =
toto_maConfig.cng"
2e message : IE cannot download your... Site indisponible.

Je ne comprends pas.
Auriez-vous quelques lumières ?

Mon code ($usage = "toto" dans mon test, $contenuFichier = une
description de ma config)

header("Content-Type: application/force-download");
header("Content-Transfer-Encoding: binary");
header('Content-Disposition: attachment; filename=' . $usage .
'_maConfig.cng');
header ("Cache-Control: no-store, no-cache, must-revalidate,
post-check=0, pre-check=0");
header("Pragma: no-cache");
header("Expires: 0");
echo $contenuFichier;

En vous remerciant pour votre aide.

Cordialement

Clo

-- 
Se désabonner ? Envoyez un mail à php-france-unsubscribe@[...].org
Plus d'informations ? Envoyez un mail à sympa@[...].org ayant pour sujet HELP
Thread:
Claude C.
Claude C.

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved