0

Hi. I've three websites on a VPS Server running Apache 2. Each website has been successfully uploading files until now. None of them can upload a pdf file but has no problem with other file types that I allow, such as jpeg.
If I examine the $_FILES array, when uploading a jpg, the [type] is shown as 'image/jpeg' which is permitted. When I upload a pdf, the [type] is revealed as 'application/ltd' and fails to upload. I'm expecting 'application/pdf' as the [type].
Does anyone know what might be going on here?
Thanks

2
Contributors
7
Replies
11
Views
5 Years
Discussion Span
Last Post by cereal
0

Ah, I'm only PHP 5.2 and finfo_file() is for > 5.3, according to the link that you kindly posted.
Thanks for the post cereal

0

My wife's Macbook Pro doesn't have a problem uploading pdfs and the $_FILES array [type] shows these as pdfs whereas my PC shows them as ldt, and won't upload.

0

Yes I know, this mainly depends on how the browser determines the mime-type, for example Firefox use different methods to determine mime-types, on MacOS it uses type and creator code:

- https://developer.mozilla.org/en/How_Mozilla_determines_MIME_Types

This is way I suggested you to use finfo or exec/file, both use magic file which is used in *nix box to determine file mime-types:

- http://en.wikipedia.org/wiki/File_(command)

You may want to wait for someone else solution. Bye :)

Edited by cereal: n/a

0

This is way I suggested...

My bad English! Among other mistakes I meant "why" not "way".. I'm sorry this is not my first language :D

0

Ah ha! The problem doesn't occur with Safari or IE8. It's a Firefox thing (again).
Thanks for all your help

Edited by k90tour2: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.