views:

227

answers:

8

I am trying to create an application to print documents over the web. I have created my document, and made a web page with a meta refresh tag, along the lines of this:

<meta http-equiv="refresh" content="3;http://example.com/download.epl2" />

I specify that the document has a content-type of application/x-epl2, and I have associated .epl2 files on my computer with a program that silently sends them to the printer.

I have put the website into my trusted sites zone.

Currently Internet Explorer pops up the "Open, Save, Cancel" dialog box with no option to automatically open the file.

Is there a setting in IE6/7/8 that I can use to have IE just open the file without prompting?

EDIT

The actual content of the file will differ based on the job, but essentially it is text that follows the Eltron Programming Language.

EDIT

I have accomplished this in both Chrome and Firefox by choosing "Automatically Open Files Of This Type From Now On"

EDIT

The machines this program will be used on will effectively be kiosks that are limited to only accessing my website from their web browsers, so I'm not worried about rogue websites sending documents to my printers.

EDIT

I am using PHP to generate the documents and HTML on the server side, though I expect the solution to be language agnostic.

+6  A: 

I would expect that not to be possible, because then you could stumble onto a site that automatically loads and prints a 5000 page document or something, which would not be good.

jonathanasdf
I think it's possible with IE bugs. You just never should keep Your paper stacke in the printer :)
naugtur
+1  A: 

I would use javascript to make this happen.

Javascript Window Open

EDIT

Since you have control of the windows box you could use an automate script process to interact with the print window.

autoit3: ControlClick

Brant
that won't start the printing
naugtur
Ok, now that You edited... ;)
naugtur
A: 

I don't have time to investigate it for You, but there were lots of exploits that could be helpful. Using ie6 without certain fixes seems helpful.

Also there should be an option called "Automatic prompting for file downloads". I use Linux nowadays so I can't chceck if it helps. I found it in some docs.

naugtur
A: 

I'm on a Mac at the moment, but if this is possible in IE I would imagine this page holds the answer to it (or at least hints at it) http://support.microsoft.com/kb/883255

davbryn
+1  A: 

If you always had a secret desire to develop a custom URL protocol (I know I do), this might be a good excuse to do it. ;-)
http://msdn.microsoft.com/en-us/library/aa767914%28VS.85%29.aspx

There are 1-2 prompts when opening such a link for the first time in IE, but you can choose to automatically open them after that.

acezanne
A: 

I believe what you're looking for is a setting in Windows, not IE: Microsoft Support: Not Prompted to Specify Download Folder for File

gnobal
A: 

Try using an older version of IE. Security was looser in the older versions and since it's a non-issue, this could be the quickest solution.

Tychumsempir
+1  A: 

Write a small utility program that does nothing but send the file passed to it on the command-line to the default system printer.

Then, edit the registry under HKEY_CLASSES_ROOT to associate this program with the .epl2 filetype.

kurige
This works for Chrome, but for IE I still get a confirmation dialog. The program I'm using is PrintFile, which is a very good application for this purpose.
Martin
Hmm... That's all I've got. If, however, you've already got a program like PrintFile setup, then it would be relatively "easy" to simply write a AutoIt script, as suggested below. Just have it wait for an IE popup and have it automatically click "Open".
kurige