1

How can I force a download from an external host? It had been working by default on desktop and mobile but recently stopped working on mobile. Forcing it via .htaccess file does not work.

I searched and found two possible solutions - one is by using CURL and the other PHP. I'm leaning towards PHP. These two solutions are located here and here

Using the PHP method I created this file:

$file_name = 'file.mp3';
  $file_url = 'https://partyfavorz.podbean.com/' . $file_name;
  header('Content-Type: application/octet-stream');
  header("Content-Transfer-Encoding: Binary"); 
  header("Content-disposition: attachment; filename=\"".$file_name."\""); 
  readfile($file_url);
  exit;

I named it download.php. However, I do not know where to place this file. I uploaded it to the public_html folder but that had no effect.

double-beep
  • 5,031
  • 17
  • 33
  • 41
  • Is this _"download"_ as meaning play inside an ` – VC.One Apr 22 '19 at 13:35
  • Download to disk (save file). It works on desktop but no longer in mobile. It's coming from an external source Podbean who just replied and said it's not on their end. Could it be my CDN? –  Apr 26 '19 at 14:05

0 Answers0