开发者

How Can I Automatically Execute A Link In Internet Explorer

开发者 https://www.devze.com 2022-12-26 08:57 出处:网络
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:

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.


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.


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.


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


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.


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.


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


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号