getk2 / k2

K2 - the powerful content extension for Joomla
https://getk2.org
GNU General Public License v3.0
135 stars 96 forks source link

wrong attachment name #213

Closed oligalma closed 8 years ago

oligalma commented 10 years ago

Hi, I attached some file types (png, rtf, pdf) to a K2 item and they are stored well. However: I attached a css file called "main.css" to a K2 item but it is stored as "main.css.txt" instead of "main.css". I attached a php file called "main.php" to a K2 item but it is stored as "main.php.txt" instead of "main.php".

thanks for your attention Marc

K2Joom commented 10 years ago

Marc,

I tested in J! 2.5 and 3.3 with K2.6.8 and see the same with .css files.

Refer to this: http://getk2.org/community/English-K2-Community/179354-docx-mimetype-tries-to-open-as-zip-where-to-add

I have checked the file and see 'css' => 'text/css', which from my understanding is the correct MIME type.

CSS is not set as a dangerous file type, which is normally when a file type is converted to text file.

It could be browser (FF) sending the wrong MIME type information on submission or your server not detecting correctly.

Take a look at this issue too for reference: https://github.com/joomlaworks/k2/issues/54

kavadas commented 8 years ago

@oligalma

It's your server that fails to detect the correct mime type of the file in all possible ways. Then the class we are using is taking the last option which is what the browser says. You have to either update your server's PHP version and setup or try to use a different browser. As @K2Joom correctly wrote the issue is discussed in detail in #54 .