Keyword

K2 2.10.0 Uploaded attachment wrong file extension

  • MGS Creativa
  • MGS Creativa's Avatar Topic Author
  • Offline
  • Senior Member
More
4 years 4 months ago #173771 by MGS Creativa
Hi! I uploaded a XLS file through K2 new item editor in backend but the file got .txt file extension after upload
Attachments:

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago #173790 by JoomlaWorks
Replied by JoomlaWorks on topic K2 2.10.0 Uploaded attachment wrong file extension
Can you describe your hosting environment please? E.g. which webserver (Apache/IIS/Nginx), PHP version & Joomla version.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • MGS Creativa
  • MGS Creativa's Avatar Topic Author
  • Offline
  • Senior Member
More
4 years 4 months ago - 4 years 4 months ago #173814 by MGS Creativa
Replied by MGS Creativa on topic K2 2.10.0 Uploaded attachment wrong file extension
Hi! server Ubuntu 18.04, PHP 7.1.33 j! 3.9.13

The MIME type got wrong here

media/k2/assets/vendors/verot/class.upload.php/src/class.upload.php upload function near line 2381
if ($path) {
                            $f = @finfo_open(FILEINFO_MIME, $path);
                        } else {
                            $this->log .= '&nbsp;&nbsp;&nbsp;&nbsp;MAGIC path will not be used<br />';
                            $f = @finfo_open(FILEINFO_MIME);
                        }
                        if (is_resource($f)) {
                            $mime = finfo_file($f, realpath($this->file_src_pathname));
                            finfo_close($f);
                            $this->file_src_mime = $mime;

Given MIME is application/vnd.ms-office

Attached zipped XLS file for testing
Attachments:
Last edit: 4 years 4 months ago by MGS Creativa.

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago #173820 by JoomlaWorks
Replied by JoomlaWorks on topic K2 2.10.0 Uploaded attachment wrong file extension
Using Apache or Nginx? MIME configuration all set in there?

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum