odbhut.shei.chhele
odbhut.shei.chhele

Reputation: 6234

Cannot open pdf file in browser using fpdf

I am new to fpdf. In my application, if a user clicks on a link, then I create a pdf file and the file gets downloaded. But I wanted the file to be opened in the browser. Here is my code

$fpdf->Output("Circular.pdf", "I");

But the code isn't working. The browser is showing garbage. I don't know what I am doing wrong. In the attached image you can see the output that I can see in the browser.

enter image description here

Upvotes: 0

Views: 580

Answers (1)

just somebody
just somebody

Reputation: 19247

read up on the Content-Type header: https://www.rfc-editor.org/rfc/rfc2616#section-14.17

Upvotes: 1

Related Questions