(php)permettre de voir ou télécharger un doc
Résolu/Fermé
guillaume_74
guillaume_74
- Messages postés
- 111
- Date d'inscription
- samedi 18 octobre 2008
- Statut
- Membre
- Dernière intervention
- 29 juillet 2010
guillaume_74
- Messages postés
- 111
- Date d'inscription
- samedi 18 octobre 2008
- Statut
- Membre
- Dernière intervention
- 29 juillet 2010
A voir également:
- (php)permettre de voir ou télécharger un doc
- (php)permettre de voir ou télécharger un doc ✓ - Forum - PHP
- Comment voir les téléchargements en cours sur windows 10 ✓ - Forum - Téléchargement
- Télécharger google docs gratuit - Télécharger
- Comment telecharger un doc. Word depuis mon s ✓ - Forum - Webmaster
- Telecharger fichier doc et ou exl depuis appli FreeBOX ✓ - Forum - Freebox
3 réponses
guillaume_74
16 déc. 2009 à 11:19
- Messages postés
- 111
- Date d'inscription
- samedi 18 octobre 2008
- Statut
- Membre
- Dernière intervention
- 29 juillet 2010
16 déc. 2009 à 11:19
Personne ne sait faire?
guillaume_74
16 déc. 2009 à 11:40
- Messages postés
- 111
- Date d'inscription
- samedi 18 octobre 2008
- Statut
- Membre
- Dernière intervention
- 29 juillet 2010
16 déc. 2009 à 11:40
Je pense avoir trouvé mon problème, c'est qu'il y a un affichage HTML dans la page ou j'appelle le "header" c'est possible que cela vienne de la?
guillaume_74
16 déc. 2009 à 14:31
- Messages postés
- 111
- Date d'inscription
- samedi 18 octobre 2008
- Statut
- Membre
- Dernière intervention
- 29 juillet 2010
16 déc. 2009 à 14:31
Bon (même si tout le monde s'en fou...) j'ai trouvé le problème, il faut faire un "exit" a la fin du code!
Et maintenant ca marche bien ;)
$path='documents/'. $document; $document=strtolower($document); @ob_end_clean(); @ob_clean(); @ini_set('zlib.output_compression', 'Off'); header('Pragma: public'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Cache-Control: public'); header('Content-Type: application/force-download'); header('Content-Type: application/octet-stream'); header('Content-Type: application/download'); header('Content-Disposition: attachment; filename="'.basename($path).'";'); header('Content-Transfer-Encoding: binary'); header('Content-Length: ' . filesize($path)); flush(); readfile($path); exit();
Et maintenant ca marche bien ;)