0

I use POST requests to transfer data that is needed to create the downloadable document on the fly.

When the form is submitted, the $_POST array is passed to a function that returns the path of a created FDF file.

The code:

header('Content-Type: application/pdf');
header('Content-Disposition: attachment; filename="'.$file.'"');
passthru("pdftk file.pdf fill_form ".$fdf_file." output - ");
exit;

Work on all browser (Safari, Firefox, Opera, Chrome, Internet Explorer) but not in Android stock browser.

In Android browser, the download taking place but the content of the file being empty or some HTML garbage, or the browser downloading the file but ignoring my file name and trying to save the file under the name of the script that generated it.

Any help is much appreciated.

Thanks!

UPDATE!!!

the solution: http://digiblog.de/2011/04/19/android-and-the-download-file-headers/

2 Answers2

0

Try sending the binary encoding header:

header("Content-Transfer-Encoding: binary");

If still not, you may have to send the file under a different file type.

j0k
  • 22,600
  • 28
  • 79
  • 90
0

the solution:

Android and the HTTP download file headers http://digiblog.de/2011/04/19/android-and-the-download-file-headers/

  • 1
    Note that [link-only answers are discouraged](http://meta.stackoverflow.com/tags/link-only-answers/info), SO answers should be the end-point of a search for a solution (vs. yet another stopover of references, which tend to get stale over time). Please consider adding a stand-alone synopsis here, keeping the link as a reference. – kleopatra Oct 05 '13 at 08:41