- 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 months 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: 6227
5 years 5 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.
Please Log in or Create an account to join the conversation.
- MGS Creativa
-
Topic Author
- Offline
- Senior Member
Less
More
- Posts: 54
5 years 5 months ago - 5 years 5 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: 5 years 5 months ago by MGS Creativa.
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
Less
More
- Posts: 6227
5 years 5 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?
Please Log in or Create an account to join the conversation.