Keyword

K2 2.10.0 Uploaded attachment wrong file extension

  • MGS Creativa
  • MGS Creativa's Avatar Topic Author
  • Offline
  • Senior Member
More
9 months 4 weeks 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.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
9 months 4 weeks ago #173790 by Fotis
Can you describe your hosting environment please? E.g. which webserver (Apache/IIS/Nginx), PHP version & Joomla version.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • MGS Creativa
  • MGS Creativa's Avatar Topic Author
  • Offline
  • Senior Member
More
9 months 4 weeks ago - 9 months 4 weeks 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: 9 months 4 weeks ago by MGS Creativa.

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

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
9 months 4 weeks ago #173820 by Fotis
Using Apache or Nginx? MIME configuration all set in there?

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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


Powered by Kunena Forum