Downloading files to Android default browser using PHP fails to recognise MIME type

I have a web site used by around 200 users one of whose functions is to download documents on request.

The download works fine on a PC but on an Android device using the default browser it fails to recognise the file type, with the result that the user can't read the file.   On the same device the Chrome browser works fine.

I'm using the download code from webinfopeadia (attached).
download.php
DavidRMasonAsked:
Who is Participating?
 
DavidRMasonAuthor Commented:
Thanks for the suggestions.

Having done some research I came across this article:
http://www.digiblog.de/2011/04/android-and-the-download-file-headers/

My initial attempts to resolve using the ideas in this article hadn't worked so I posted the above on Experts Exchange to see if the experts had some better ideas.

However while awaiting a response I came back to the above article and if you read in depth you will see that there are problems with downloading if it is in response to a "POST" request.    

I have done a test using the "GET" method and it works fine.

Thanks for your help
0
 
RobOwner (Aidellio)Commented:
Have you got a link to your site that I can test?

What is the mime type that's failing?
0
 
gheistCommented:
Your code does not handle office 2007 documents.
mime.types of apache is better place for file types vs mime
0
 
RobOwner (Aidellio)Commented:
No problem.  go ahead and mark your comment as the solution :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.