Downloading Files from a Weblistbox

I can use WebFile.Open(MyFIle) in the double clicked event of a weblistbox

But: can anyone think of a way to make the download happen in a new browser window?

To work reliably with various popup blockers, you’ll need the user to click a real link.

I am aware of the popup blocker issues. AS this is an internal system, we control all the users browsers.

Can anyone think of a way to make it work IN a weblistbox?

@Jay Menna
What’s happens now?

The file, if it is readable in the browser (Pdf is safari) takes over the current Safari window: The session dies.

So, you could force it to download – WebFile.ForceDownload – or, create a special viewing page with a WebHTMLViewer embedded and display there. That second option may not work with all browsers.

Use this:

ExecuteJavascript("'" + MyFIle.URL + "','_blank');")

This requires that Block Popup Menus is turned OFF, but it will open in a new Tab/Window (depending on the browser’s settings).

Browsers will initially block the “popup” from showing but can alert you about it so you can turn on popups for the specific app/website and the user won’t have to deal with it in the future. I don’t know about IE etc… but Chrome seems to handle this nicely.

Thanks Greg!