previousHTTP_Download::setContentDisposition (Previous) (Next) HTTP_Download::sendnext

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

HTTP_Download::guessContentType

HTTP_Download::guessContentType() – Guess content type of file

Synopsis

mixed HTTP_Download::guessContentType ( )

Description

Use only if you send a file.

First we try to use MIME_Type, if installed, to detect the content type, else we check if ext/mime_magic is loaded and properly configured.

Returns PEAR_Error if:

  • MIME_Type failed to detect a proper content type (HTTP_DOWNLOAD_E_INVALID_CONTENT_TYPE)
  • ext/magic.mime is not installed, or not properly configured (HTTP_DOWNLOAD_E_NO_EXT_MMAGIC)
  • mime_content_type() couldn't guess content type or returned a content type considered to be bogus by setContentType() (HTTP_DOWNLOAD_E_INVALID_CONTENT_TYPE)

Return value

Returns TRUE on success, PEAR_Error on failure.

Note

This function can not be called statically.

previousHTTP_Download::setContentDisposition (Previous) (Next) HTTP_Download::sendnext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.