0

Filedownload.save with IE 8

asked 2010-11-11 09:10:36 +0800

moloch gravatar image moloch
606 1 13

Hello,
i want to show the content of my file in a new browser window. it works fine with firefox but ie8 does not open a new window it use the current. but i want to show the content in a new window.
please tell me how to do this

	
	String letter = getLetter();
	Filedownload.save(letter, "html", "letter.html");

delete flag offensive retag edit

9 Replies

Sort by ยป oldest newest

answered 2010-11-15 00:33:54 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

it seems that's a browser default behavior.

link publish delete flag offensive edit

answered 2010-11-15 02:09:10 +0800

moloch gravatar image moloch
606 1 13

yes i think so too. But how can i fix it from the code?

link publish delete flag offensive edit

answered 2010-11-15 02:16:44 +0800

xmedeko gravatar image xmedeko
1031 1 16
http://xmedeko.blogspot.c...

Hi moloch,
maybe we look for the same solutution, see http://www.zkoss.org/forum/listComment/14410

link publish delete flag offensive edit

answered 2010-12-29 03:35:17 +0800

moloch gravatar image moloch
606 1 13

hi,
my problem is "only" that my file is not shown in a new window of the ie8 like in the firefox.
has nobody an idea how i can fix it?

link publish delete flag offensive edit

answered 2011-01-19 06:52:51 +0800

moloch gravatar image moloch
606 1 13

nobody can help?

link publish delete flag offensive edit

answered 2011-01-19 08:18:57 +0800

xmedeko gravatar image xmedeko
1031 1 16
http://xmedeko.blogspot.c...

@moloch: what about to change the security in IE8? Otherwise you can try a workaround: make a HTML link

<a href="showit.zul" target="_blank"/>Show it</a>

and perform the
Filedownload.save(letter, "html", "letter.html");

in the "showit.zul" file.

link publish delete flag offensive edit

answered 2011-01-20 01:20:00 +0800

moloch gravatar image moloch
606 1 13

hi, thanks for your answer.
should i open a new page with a button click? with your link it will work but i don t want a link i still want a button maybe i should open a new page with any method?
than i would do your workaround...

1. i open a new zul page in a new browser window
2. in the composer of the new zul page i will call filedownload.save

right?

greets

link publish delete flag offensive edit

answered 2011-01-20 03:31:15 +0800

xmedeko gravatar image xmedeko
1031 1 16
http://xmedeko.blogspot.c...

No, it won't work. The problem is in the IE security settings. By default, it requires a user to confirm a save dialogue opened by JavaScript only. If you open a new window by a click to the link, then it should work. Now I think even my advice is not good, I guess the ZUL cannot be used for this (maybe it can, I have not tried). I think the safe way is to make a "dowload servlet" and serve the content directly. Something like

<a href="/downloadservlet" target="_blank"/>Show it</a>

I think I will make such a download servlet later, see my discussion http://www.zkoss.org/forum/listComment/14410 (Now I have something else to do.)

I am not sure if IE allows you to open a new window by JavaScript only (by a button), you can try it like (JavaScript ):

window.open(url, name, windowFeatures);

Or just simply change the security settings of IE, if you can.

link publish delete flag offensive edit

answered 2011-01-25 07:08:22 +0800

moloch gravatar image moloch
606 1 13

thats an option but what is when i want open a new tab of the browser? is this possible instead a new complete browser window?

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-11-11 09:10:36 +0800

Seen: 1,030 times

Last updated: Jan 25 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More