Pergunta

What
Mobile Andriod 2.3 default browser

Problem
I am having PHP submit headers to try and download PDF & Text files. The Phone looks like its downloading the file but it says "<Untitled>" and stays in progress.

Other
I have noticed in Opera on the same phone the file downloads. Also every desktop browser works fine too

Headers

header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: public');

header('Content-Type: application/octet-stream');

header('Content-Length: ' . $FileSize);
header('Content-Disposition: attachment; filename="' . strtoupper( $FullFileName ) . '"');
header('Content-Transfer-Encoding: binary');

echo($Content);
Foi útil?

Solução

There were 2 problems.

  1. SSL certificates needs to be VALID for Andriod 2.3. On my test sites the download will never work because the certs aren't valid.
  2. Changing "Content-Type" to say "application/pdf" for PDFs also needed to be done ( if its a PDF of course )
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top