I'm going crazy with this. Been looking here and at Google for a solution. The code I copied works fine under Android, but it does nothing when I try to run it on an iPhone 6. I read that it used to work on iPhone 5 at least, but seems that there is no way to force video download on iPhone 6 and 7.
Is there any way to force or ask for a file to be downloaded on an iPhone using PHP? There's something wrong with this code or is just a pain in the ass provided by Apple?
<?php
ob_start();
if(!empty($_GET['file'])) {
$fileName = basename($_GET['file']);
$fileName = getcwd() . '/uploads/videos/' . $fileName;
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . $fileName);
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
ob_clean();
flush();
readfile($fileName);
exit;
}