WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How to

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Opening PDF or other file inside browser

 Keywords:  Opening PDF browser

Question:

I have built a selection box from a directory listing. But since the files to be viewed are PDF files, I am not sure how to open the files. What I get is a binary view of a PDF file. I believe that is because I am using the standard set of webout's used to create a html page. namely a command like this "WebOut('Content-type: text/html',2)". I think this is making the browser to think the file is a text file. If I leave the common webout commands out and just do a weboutfile command, the browser says the CGI application misbehaved by not returing a complete set of HTTP headers. Any ideas?

Answer:

Yes, the WebOut is the problem. If you are sending a PDF file the webout should read something like...

WebOut('Content-type: application/pdf',2)

The "Content Type" line is required for the Web Server and WebBrowser to properly identify what is being sent.



Article ID:   W14758
File Created: 2017:07:28:12:58:11
Last Updated: 2001:11:08:11:39:51