Closed

Set correct headers with PHP to make mobile browsers download it

This project received 7 bids from talented freelancers with an average bid price of $108 USD.

Get free quotes for a project like this
Employer working
Skills Required
Project Budget
$10 - $30 USD
Total Bids
7
Project Description

Hello everybody!

I am trying to make an android default browser download an image ( [url removed, login to view] )

I looked through the internet and got several places saying that this solution would definitely work, but it doesn't. (to test - select an animation, click "Generate preloader", then the "download now" button.

These are the headers I am setting:

header("Pragma: public"); // required
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false); // required for certain browsers
header('Content-type:application/octet-stream' );
header("Content-Disposition: attachment; filename="[url removed, login to view]"" );
header("Content-Transfer-Encoding: binary");

Note that when the "Download now" button is clicked what I do is set the src attribute in Iframe to the php script that generates the loading animation with the headers above. Script is in PHP

So I need the image starting download when the "download now" button is clicked in android default browser along with all other popular browsers both on computer and mobile devices. The solution with just changing headers will be prioritized.

PLEASE, don't bid if you can't do it :)

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online