RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.39k stars 10.51k forks source link

unable to upload viso or xmind file #23173

Open ntvis opened 3 years ago

ntvis commented 3 years ago

Description:

Unable to upload xmind files and viso files via Electron client or firefox,safari,chrome

Steps to reproduce:

Click and drag a xxx.xmind or xxxx.vsdx file from explorer window to Rocket chat window Rocket chat gives "Media Type Not Accepted: undefined" .

Expected behavior:

Dropping a file uploads it to the chat

Actual behavior:

throw error and file not upload.

Server Setup Information:

Version of Rocket.Chat Server:3.18.1 Operating System: ubuntu 18.04 Deployment Method: Client executable Number of Running Instances: 1 DB Replicaset Oplog: NodeJS Version: v12.22.1 MongoDB Version: 4.0.26 / mmapv1 (oplog enabled)

FileUpload_Enabled: true MediaTypeWhiteList: left blank MediaTypeBlackList: left blank

Client Setup Information

Desktop App or Browser Version: Desktop 3.5.0 Operating System: Windows 10 Home

debdutdeb commented 3 years ago

Hi, thanks for reporting this. Is this only happening on the electron client? Or also on the web client?

ntvis commented 3 years ago

It is happening on the electron client and on the web client(with firefox or safari or chrome etc)

ntvis commented 3 years ago

hi I add some debug code inclient/components/modals/FileUploadModal/ FileUploadModal.tsx

图片 图片

It's seem that firefox browser get the right file type, but javascript code cant't get the file type proper?

moonwolf-github commented 3 years ago

Hmm... Looks like my issue is similar. I'm unable to upload Corel (and EPS) files. Here is my forum entry.

robertfromont commented 3 years ago

I'm seeing a similar issue with ELAN transcript files - the file extension is .eaf and the file content is XML.

I've configured RC to allow any media types to be uploaded, so expected no validation on the type. Presumably the browser or RC is trying to guess a media type and failing because it's an obscure format with a niche group of users.

Would be great if allowing any media type also allowed 'undefined'!

nedos commented 2 years ago

Yeah, I can confirm this for binary file formats like elfs even executable python scripts being shared. As long as it gets parsed as undefined it fails to upload, even if set to accept all files in the File Upload settings

nedos commented 2 years ago

Would it make sense to rename this issue to something a bit more broad? Clearly, the issue is actually when rocketchat fails to parse the format, not a specific file format. I think it would be safe to assume that the majority of binary formats won't work. One workaround is to zip everything, but that's not the desired fix.