I have some binary files in Tomcat webapp folder, that I wish user to download.
I have following code: Window.open(GWT.getHostPageBaseURL()+result, "_blank", "");
I checked with GWT.log path, and it's correct - it really points to folder with certain file.
Firefox: Downloads every file as expected (either opens image/xml in new tab or prompts save dialog)
Chrome: Seems to be downloading only .zip from what I tried. Others are ignored, nothing happens.
IE8: Opens image/XML in new IE Window. Others are ignored (f.e ZIP blink new window but won't prompt save dialog)
What am I doing wrong? Thanks
This error means that your computer's security settings blocked the file. Learn more about blocked downloads. On Windows: Windows Attachment Manager could have removed the file you tried to download. To see what files you can download or why your file was blocked, check your Windows internet security settings.
I'd suggest using a tool like Fiddler to diagnose this problem by examining the HTTP requests and responses in more detail.
My hunch is it'll turn out to be a mime-type issue, but it's hard to say much for sure without seeing more of what's going on.
According to this discussion from GWT-group problem with chrome can be that it blocks popups generated by javascript(or callbacks in GWT), but allows to open new window if it's result of user interaction(or button click in GWT).
I recently built something for our organisation more as a cache-buster for use with IE than anything else.
If you could check your output script has the following in it, somewhere at least:-
response.setHeader("Pragma", "public");
response.setHeader("Cache-Control", "max-age=0");
response.setHeader("Content-Disposition", "attachment; filename=\"" + yourfilenamehere + "\"");
Hope this is of some help anyway. The content-disposition thing seemed to be the one that was flaking IE out to be fair, but the caching ones are just practice in my opinion when pulling a file from disk.
Good Luck with your fix!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With