- Posts: 2
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- Attachments STILL broken? Problems with MP3 files being renamed to TXT
Attachments STILL broken? Problems with MP3 files being renamed to TXT
- James Riley
- Offline
- New Member
Fotis wrote: Try commenting out this line: github.com/getk2/k2/blob/master/administrator/components/com_k2/models/item.php#L439
Let me know.
I've commented out Line 439 [ $handle->file_new_name_body = JFile::stripExt($filename); ]
The file is not only still saved as a txt file, but also renamed with a random file name (see attached screen clipping; you can see the original file name maintained in the download link).
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
- Posts: 6218
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Adam M
- Offline
- New Member
- Posts: 5
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
- Posts: 6218
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",
"audio/*",
"video/*"
);
Let me know.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Adam M
- Offline
- New Member
- Posts: 5
Please Log in or Create an account to join the conversation.
- Adam M
- Offline
- New Member
- Posts: 5
system information
- class version : 0.34dev
- operating system : Linux
- PHP version : 7.3.18
- GD version : 2.1.0
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- upload_max_filesize : 8M (8388608 bytes)
- language : en_GB
source is a local file /tmp/phpDsPdnR
- local file OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
Fileinfo PECL extension not available
- Checking MIME type with UNIX file() command
MIME type detected as audio/mpeg; charset=binary by UNIX file() command
- MIME validated as audio/mpeg
source variables
- You can use all these before calling process()
file_src_name : phpDsPdnR
file_src_name_body : phpDsPdnR
file_src_name_ext :
file_src_pathname : /tmp/phpDsPdnR
file_src_mime : audio/mpeg
file_src_size : 1956870 (max= 8388608)
file_src_error : 0
process file to /public_html/media/k2/attachments/
- file size OK
- script renamed as phpDsPdnR.txt!
- file mime OK : text/plain
- new file name body : isnt-she-lovely
- destination variables
file_dst_path : /public_html/media/k2/attachments/
file_dst_name_body : isnt-she-lovely
file_dst_name_ext : txt
- no auto_rename if same filename exists
- destination file details
file_dst_name : karlo-isnt-she-lovely.txt
file_dst_pathname : /public_html/media/k2/attachments/isnt-she-lovely.txt
cleanup
- delete temp file /tmp/phpDsPdnR
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
- Posts: 6218
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
- Posts: 6218
So anyone who had issues before is advised to test this one out.
Thank you.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Adam M
- Offline
- New Member
- Posts: 5
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
- Posts: 6218
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- Attachments STILL broken? Problems with MP3 files being renamed to TXT