-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello!
I'm using ZK 9.6.0.1 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! :)
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.
Asked: 2022-11-23 19:34:08 +0800
Seen: 7 times
Last updated: Nov 29 '22