Menu Content

Podpora

> Diskusní fóra, FAQs & placená podpora
Welcome, Guest
Username Password: Remember me

Bad Content-Type
(1 viewing) (1) Guest
Support forum for users using free edition of JoomDOC. These forums are mainly for mutual help between users.

NOTE: Due to our capacity limitations, ARTIO does not monitor this forum category regularly. If you want direct support from ARTIO, please start a ticket at Support Dashboard. If you have no support ticket available, you need to purchase it.
  • Page:
  • 1

TOPIC: Bad Content-Type

Bad Content-Type 13 years, 3 months ago #23905

when trying to download some document, it can be downloaded, but the content-type is "text/html" and not by the real file type. by this, the browser is confised, when it gives the "open with" option.

I tried disable/enable SEF, without success.

Is here some configuration for it? I can fint nothing related...

Joomla 1.7.0 an JoomDoc 3.1.2
Last Edit: 13 years, 3 months ago by slavko. Reason: forgot versions

Re: Bad Content-Type 13 years, 3 months ago #23948

OK. i will reply to my self :-) But for others, the problem is in administrator/components/com_joomdoc/libraries/joomdoc/filesystem/filesystem.php, where is condition (around line 462):
if (function_exists('mime_content_type')) {
header('Content-Type: ' . mime_content_type($fullPath) . '; charset=UTF-8');
}

If the 'mime_content_type' function doesn't exists, there is not Content-Type header added to document, simply adding one else with fallback to 'octet-stream' solves this (for me):
if (function_exists('mime_content_type')) {
header('Content-Type: ' . mime_content_type($fullPath) . '; charset=UTF-8');
} else {
header('Content-type: octet-stream');
}


There exist the fileinfo functions in PHP too, but at my hosting they do not works...

Thanks to artio for great component (realy) and for great support (joke)...
  • Page:
  • 1
Přihlášení uživatele Prázdný