rust-httpd icon indicating copy to clipboard operation
rust-httpd copied to clipboard

PDF not rendering.

Open PritiKumr opened this issue 7 years ago • 1 comments

PritiKumr avatar Apr 12 '17 13:04 PritiKumr

You will need some headers to render your pdf. If you match the extension of the file, you can build headers based on them. Files that you want rendered in the browser should have a Content-Type and Content-Disposition header. This should work:

Content-Type: application/pdf
Content-Disposition: inline; filename="pdffile.pdf"

AndyGauge avatar Apr 14 '17 16:04 AndyGauge