FileDownload.save doesn't work on mobile

asked 2022-11-23 19:34:08 +0800

manuela0000 gravatar image manuela0000
7 1

updated 2022-11-23 19:34:48 +0800


I'm using ZK and I'm using FileDownload.save() function to download a file that is located in a folder of the server. It works perfectly on desktop browser, but from mobile nothing happens. How can I do?

Thanks in advance! :)

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-11-29 17:55:06 +0800

MDuchemin gravatar image MDuchemin
2480 1 6
ZK Team

From a quick test on my side, Filedownload.save works on android (chrome / firefox) and on ios (chrome).

The only one being "special" is safari on iOS. at the current time, safari on iOS has a setting "block popups" which blocks downloads for no reasons. The API works as intended, the download works as intended, but the safari popup blocker just stops it.

Just a FYI, Safari on iOS does a lot of weird things for no reason :D

There is more info on this tracker ticket: https://tracker.zkoss.org/browse/ZK-3511

The end result is since safari on iOS just change their settings all the time, instead of trying to create a workaround for the filedownload, the recommendation if you want to support safari on iOS downloads is to open the download in a new tab using either: https://www.zkoss.org/javadoc/8.0.0/zk/org/zkoss/zk/ui/Desktop.html#getDownloadMediaURI(org.zkoss.util.media.Media,%20java.lang.String) or https://www.zkoss.org/javadoc/8.0.0/zk/org/zkoss/zk/ui/Desktop.html#getDynamicMediaURI(org.zkoss.zk.ui.Component,%20java.lang.String)

and navigating to the download's generated URI.

The alternative is to use chrome or firefox on iOS.

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

1 follower



Asked: 2022-11-23 19:34:08 +0800

Seen: 7 times

Last updated: Nov 29 '22

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