Download file not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • adikat

    #1

    Download file not working

    I am trying to set up a webpage where a user can download a .PNG image. The download works fine via computer and browser but it doesn't work when I try to download it via a browser on my Android phone. It tries to download but then give me 'download unsuccessful' it doesn't give any other errors.

    Here is the PHP code that I am using:
    Code:
    header('Content-Description: File Transfer');
    		header('Content-Type: image/png');
    		header('Content-Disposition: attachment; filename=filename.png');
    		header('Content-Transfer-Encoding: binary');
    		header('Expires: 0');
    		header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    		header('Pragma: public');
    		header('Content-Length: ' . filesize($file));
    		ob_clean();
    		flush();
    		echo $file;
    Any ideas?
Working...