WebView pops a download/save dialog - how to disable?

Shoom wrote:

I wrote a program that has a viewer for arbitrary files.
the code is

html2contorl.LoadURL(filename)
If the file is recognized, it's being shown in the html2 control.

But if it's not known (e.g. "xxxxx.bak" file) it pops up the following
dialog.
I'd like to prevent it from poping up, and silently do nothing (or
catch an exception).

Well, you surely don't want it to "do nothing". You want it to save the
file to disk, right? Why go through the browser at all? Why not use
urllib2 and fetch the file directly?

You can certainly change the associations based on the file's extension,
but what would you have it do for those types?

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Actually I do want it to do nothing, (in case of failure).
I need an arbitrary local file preview in my program, without user interaction (like “quick-view” in many file managers)
It should handle most of the commonly viewable file types, namely images, videos, and texts,
so a web-view control is just perfect.

(The users can open the file properly, if they want)

@robin - i just made an extension based filter :-P, it was faster than asking the list about … IE…

thank you all.

···

On Wednesday, February 27, 2013 8:35:49 PM UTC+2, Tim Roberts wrote:

Shoom wrote:

I wrote a program that has a viewer for arbitrary files.

the code is

html2contorl.LoadURL(filename)

If the file is recognized, it’s being shown in the html2 control.

But if it’s not known (e.g. “xxxxx.bak” file) it pops up the following

dialog.

I’d like to prevent it from poping up, and silently do nothing (or

catch an exception).

Well, you surely don’t want it to “do nothing”. You want it to save the

file to disk, right? Why go through the browser at all? Why not use

urllib2 and fetch the file directly?

You can certainly change the associations based on the file’s extension,

but what would you have it do for those types?


Tim Roberts, ti...@probo.com

Providenza & Boekelheide, Inc.