I am using Nexus 7 to test, any other platforms don't have same situation as far I can test on. I use handle.php to handle the download, before echo
the file content, I used:
header('Content-length:' . $row['size']);
header('Content-type:' . $row['mime']);
and
header('Content-Disposition:inline; filename="' . $row["file_name"] . '"');
then I use android to download the file, the file name is however handle.pdf
, if I change the last row of my code into
header('Content-Disposition:attachment; filename="' . $row["file_name"] . '"');
and interesting, the file name became what I want.
Does Android fail to get file name if the Content-Disposition
is inline
and only accept the file name with attachment
?
By the way, I used the Native Chrome Browser (32.0) and in Android 4.4.2.