Вопрос

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

the solution:

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

Другие советы

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top