views:

285

answers:

0

Hi,

I am creating an Iframe and adding it to the current document and it is being used as a file download target. Here is the code...

var dl = Ext.DomHelper.append(document.body, {
    tag: 'iframe',
    id:'downloadIframe',
    frameBorder: 0,
    width: 0,
    height: 0,
    css: 'display:none;visibility:hidden;height:0px;',
    src: 'http:\\www.fg.com\something\something\darkside.pdf'
});

Ext.get(dl).on('load', function(e, t, o) {
    alert('ready to save or open the pdf')
});

This works perfectly in Firefox but not in Chrome nor Safari. My guess is that both don't create a popup dialog that asks the user whether to save or open the file. Correct me if I'm wrong, but I think for both Chrome and Safari, it automatically downloads the file.

How do I then check if the file has been downloaded for Safari & Chrome?

Thanks in advance!