0

Filedownload.save with filname with sharp (octothorp)

asked 2016-04-01 13:45:07 +0800

neonomaly gravatar image neonomaly
3 1

updated 2016-04-01 13:46:34 +0800

Hi guys, I try to call Filedownload.save(<somecontent>, "text/plain", "Somename#1.txt"); and after this call my browser going to download file with name Somename (without #1.txt)

How should I call Filedownload.save to get file with correct name? Thanks!

delete flag offensive retag edit

Comments

>https://www.zkoss.org/zkdemo/filehandling/filedownload That doesn't work for me... I have only name (with sharp), content-type and byte array with data in pure java. Can someone offer other options? Thanks!

neonomaly ( 2016-04-02 17:22:10 +0800 )edit

3 Answers

Sort by ยป oldest newest most voted
0

answered 2016-04-01 18:04:12 +0800

Darksu gravatar image Darksu
1991 1 4

Hello neonomaly,

Please use the following example:

https://www.zkoss.org/zkdemo/filehandling/filedownload

Best Regards,

Darksu

link publish delete flag offensive edit
0

answered 2016-04-03 14:44:53 +0800

neonomaly gravatar image neonomaly
3 1

That doesn't work for me... I have only name (with sharp), content-type and byte array with data in pure java. Can someone offer other options? Thanks!

link publish delete flag offensive edit
0

answered 2016-04-03 21:21:06 +0800

Darksu gravatar image Darksu
1991 1 4

Hello neonomaly,

Regarding the byte array you can start by using the following script:

<button label="test">
<attribute name="onClick">
<![CDATA[
String example = "This is an example";
byte[] bytes = example.getBytes();

Filedownload fdl = new Filedownload();
fdl.save(bytes, "text/plain", "test.txt");
]]>
</attribute>

Furthermore can you give an example of a name (with sharp)?

Best Regards,

Darksu

link publish delete flag offensive edit
Your answer
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
1 follower

RSS

Stats

Asked: 2016-04-01 13:45:07 +0800

Seen: 18 times

Last updated: Apr 03 '16

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