- Posts: 54
COMMUNITY FORUM
K2 2.10.0 Uploaded attachment wrong file extension
- MGS Creativa
- Topic Author
- Offline
- Senior Member
Less
More
5 years 5 hours ago #173771
by MGS Creativa
K2 2.10.0 Uploaded attachment wrong file extension was created 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
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
4 years 11 months ago #173790
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
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
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 54
4 years 11 months ago - 4 years 11 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
Given MIME is application/vnd.ms-office
Attached zipped XLS file for testing
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 .= ' 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
Last edit: 4 years 11 months ago by MGS Creativa.
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
4 years 11 months ago #173820
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
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.