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('rea开发者_如何学编程dy 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!
I've got a similar problem but it happens in Firefox 4.0 as well. (The code isn't the same at all). How about trying something like
Ext.Msg.alert(a.caption, a.msg);
?
精彩评论