The dialog box is a function of the PC itself. With Windows, you can
tell the browser to "open as" any particular filetype without a dialog box.
You don't really have control over that with your website.
On my PC with Firefox, when I click on a PDF link, it opens it right up with
Acrobat Reader in it's own window, same with .doc type .. only because I
set-up the "open with" filetypes that define which program opens which links.
There are ways to output .doc and .pdf (and other types) directly into the
browser using some server-side scripts. Things like PDF to HTML on-the-fly.
This involves having your own server with the PHP or Perl modules installed.
This type of thing is very similar to PHP GD library which can alter .jpeg
images (resize, crop, watermark, etc) on-the-fly before serving them to
the visitor's browser ... instead, it does the same thing with various text
1. Is the file being delivered to the browser with a disposition of inline or attachment. If attachment then the SaveAs will always display.
2. For disposition inline, it then depends on whether the browser knows how to display it. If it can display the file it will, if it can't it will offer SaveAs.
How do i configure the headers so that the browser loads the document inline no matter what the client browser setting? Also, if the user does not have the right application (say acrobat for pdfs...) I would like some script to prevent the save as dialog box.
If the browser doesn't have a plugin to handle a particular file type then it can't display that file in the browser regardless. You can force a file to be offered for download by setting the Content-disposition to attachment but you can't force it to load in a browser if the browser or browser owner doesn't want it to.
i don't like pdfs either, but unfortunately, I have to use this file format because my bosses seem to love it. I am already facing problems with slideshows not behaving the same in different computers due to different acrobat reader versions. But i have to work around it but i cannot abandon pdf.
What they essentially want is that the documents should only be readable on screen. No printing options, no save as options. Ofcourse, i could argue that one can still take screenshots and print, or recover the file from their temp folders... but we're talking about fairly non techie bank operations staff here. It would be enough if they are not given any save as options upfront in the website. They would not try too hard to recover them.
One answer is a rights management server... but its an expensive affair.
The other solution is to password protect the file. My elearning portal can pass variables into the files, so only legitimate open requests which are routed through the elearning server can open the file. Even if they save the file and go home, they'd need a password to open it. Now again, they would not be so desperate as to get a password crack.
But this is a slightly wrong forum to ask this in... still.... does anyone know what variable name is this password field known as in a pdf? :-/
I would say that you would be looking into something other than an
internet browser. Like a dedicated program in C++ or VBasic that
is similar to a kiosk. This could then turn-off any screen saving, printing,
keyboard functions, etc ... making the mouse the only input device.
Some sort of software like that could access the files from the internet,
yet have total control over the viewer, unlike a browser.