Anyone know how to solve ios/chrome download issue?

A

Anonymous

Guest
I have download php script which works on pc/all borwsers, andorid/chrome, ios/safari

problem is ios/chrome, instead of downloading file it just opens it, i did google this and found out many have this issue but it never states how they solved it

https://developer.apple.com/forums/thread/91868
https://www.reddit.com/r/ios/comments/7e29fk/how_do_i_download_a_video_from_chrome_on_ios_11/
https://stackoverflow.com/questions/41807552/trouble-with-file-download-on-ios-google-chrome
https://bugs.chromium.org/p/chromium/issues/detail?id=574033
https://www.tutorialfor.com/questions-319971.htm


im using <a href='myscript.php download>Download</a> to download files

php

Code:
header("Content-Description: File Transfer");
            header("Content-Type: application/octet-stream");
            if (strlen($ext)>0){
              header("Content-Disposition: attachment; filename=" . $name.'.'.$ext . "");
            }else{
              header("Content-Disposition: attachment; filename=" . $name."");
            }
            header('Content-Length: ' . filesize($file));
            readfile($file);
            exit();

i have already tried header("Content-Type: application/force-download"); and also setting content-type to image/jpg, but it still doesn't work, any ideas how i could make it work on ios/chrome?
 
Back
Top