Keyword

K2 item will automatically turn into txt suffix file after uploading RAR file

  • 野草工作室
  • 野草工作室's Avatar Topic Author
  • Offline
  • New Member
  • 专业Joomla建站
More
4 years 5 months ago #176001 by 野草工作室
Why do I use the attachment function of K2 item and upload the RAR type attachment, the system will automatically change to txt suffix?
My server PHP has installed the fileinfo extension,
I upload PDF files and zip files are normal, but I cannot upload RAR files normally.
I have added a MIME type that supports rar in Joomla's media manager settings.

How can I solve this problem?
Thank you.

野草工作室提供专业Joomla建站服务
www.ycway.com

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

More
4 years 5 months ago - 4 years 5 months ago #176021 by JoomlaWorks
Try this please.

Edit this file github.com/getk2/k2/blob/90cff2f28649fd83a296e9d491ef1f21335dd88b/administrator/components/com_k2/models/item.php#L442-L443 and replace the 2 lines with:
$handle->allowed = array(
    "application/arj",
    "application/download",
    "application/gnutar",
    "application/rar",
    "application/vnd.rar",
    "application/x-bzip",
    "application/x-bzip2",
    "application/x-compressed",
    "application/x-gzip",
    "application/x-rar-compressed",
    "application/x-unknown",
    "application/x-zip-compressed",
    "application/x-zip",
    "application/zip",
    "multipart/x-gzip",
    "multipart/x-zip",
);

Let me know.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Last edit: 4 years 5 months ago by JoomlaWorks.

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


Powered by Kunena Forum