How do I make a PDF on my website download instead of opening in the browser?

Ce contenu n'est disponible qu'en roumain et en anglais ; le texte anglais est affiché ci-dessous.

How do I make a PDF on my website download instead of opening in the browser?

Configure the file response to include the Content-Disposition HTTP header with the value attachment, while keeping the correct content type, application/pdf. You can do this in the application that serves the document or through a web server rule limited to the relevant files.

For a link to a file on the same domain, the HTML download attribute is a simple alternative, although behaviour can vary between browsers. Test the download on both desktop and mobile. If the document is private, check access permissions separately: triggering a download does not prevent someone from sharing the link.

QUESTIONS SIMILAIRES

Voici quelques questions dont les réponses pourraient vous intéresser. Nous répondons aux questions importantes et pratiques de nos clients.

ABONNEZ-VOUS À LA NEWSLETTER

Abonnez-vous à notre newsletter. Nous l’utilisons uniquement pour les informations importantes.

Illustration abonnement à la newsletter