Anyone know how to solve ios/chrome download issue?

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 8
Joined: Sat Apr 18, 2020 3:55 pm

Tue Jan 19, 2021 1:29 pm

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 ... on_ios_11/ ... gle-chrome ... ?id=574033

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


Code: Select all

header("Content-Description: File Transfer");
            header("Content-Type: application/octet-stream");
            if (strlen($ext)>0){
              header("Content-Disposition: attachment; filename=" . $name.'.'.$ext . "");
              header("Content-Disposition: attachment; filename=" . $name."");
            header('Content-Length: ' . filesize($file));
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?
Post Reply