Comment inserer un lien telechargeant un pdf
ml500
Messages postés
791
Statut
Membre
-
gigaga Messages postés 2347 Date d'inscription Statut Membre Dernière intervention -
gigaga Messages postés 2347 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
je n'arrive pas à inserer un lien pouvant telecharger un fichier pdf. Car en mettant un lien normal, il telecharge le fichier pdf directement dans le navigateur, pourtant je voudrais que le fichier soit téléchargé à part comme c'est le cas avec les fichiers .doc
je n'arrive pas à inserer un lien pouvant telecharger un fichier pdf. Car en mettant un lien normal, il telecharge le fichier pdf directement dans le navigateur, pourtant je voudrais que le fichier soit téléchargé à part comme c'est le cas avec les fichiers .doc
Configuration: Windows XP Firefox 3.0.15
A voir également:
- Comment inserer un lien telechargeant un pdf
- Créer un lien pour partager des photos - Guide
- Comment insérer un espace insécable dans word - Guide
- Comment créer un pdf gratuitement - Guide
- Comment telecharger un torrent - Guide
- Insérer une vidéo dans un powerpoint - Guide
4 réponses
En fait, il faut changer l'entete pour forcer le téléchargement. En PHP par exemple:
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="downloaded.pdf"');
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="downloaded.pdf"');
OK, regarde là ou j'ai placé tes codes dans mon entete.
<head>
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="downloaded.pdf"');
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Les Publications</title>
<link rel="shortcut icon" HREF="http://barreaudelagombe.cd/folder_home/images/icone.png" >
<meta name="author" content="Mike Lukoki">
<meta http-equiv="Page-Enter" content="revealTrans(Duration=3,Transition=0)">
<meta name="generator" content="Mike Lukoki">
<style type="text/css">
</style>
</head>
<head>
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="downloaded.pdf"');
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Les Publications</title>
<link rel="shortcut icon" HREF="http://barreaudelagombe.cd/folder_home/images/icone.png" >
<meta name="author" content="Mike Lukoki">
<meta http-equiv="Page-Enter" content="revealTrans(Duration=3,Transition=0)">
<meta name="generator" content="Mike Lukoki">
<style type="text/css">
</style>
</head>
Non, voila comment il faut faire :
tu as ta page HTML avec un lien
puis un fichier nommé telecharger.php contenant (où downloaded.pdf est le nom de ton fichier PDF à télécharger) :
tu as ta page HTML avec un lien
<a href="telecharger.php">télécharger</a>
puis un fichier nommé telecharger.php contenant (où downloaded.pdf est le nom de ton fichier PDF à télécharger) :
<?php
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="downloaded.pdf"');
?>