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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RobOwner (Aidellio)Commented:
No problem.  go ahead and mark your comment as the solution :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.