Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Cant upload python files

Open prashanthym opened this issue 6 years ago • 17 comments

Description:

When I try to upload the python files, it is throwing an error as media types not accepted and here are version details

Steps to reproduce:

Add "application/x-python,application/python,application/*.py,text/python,text/x-java,text/x-script.phyton,application/x-bytecode.python,application/octet-stream" (exact MIME type) to the list of "Accepted Media Types" (Administration --> File Upload)
Open a channel
Try to upload a file produced with Python(test.py)

Expected behavior:

The file will be uploaded and a message with the attachment will be posted to the channel.

Actual behavior:

The upload will be rejected with the note "Media Types Not Accepted".

Version Details :

0.72.3

prashanthym avatar Apr 15 '19 11:04 prashanthym

Still present in the latest version (3.7.0)

rc rc2

rmaksimov avatar Oct 04 '20 22:10 rmaksimov

It's a real problem in my organization. Is there a workaround ?

clemoan avatar Nov 04 '20 21:11 clemoan

I have run into the same problem. I ended up emptying out the "Accepted Media Types" field under "File Uploads" in the settings, but even after repeated restarts, this does nothing.

Renaming my file to ".py.txt" allows me to upload it, but I would like to see this fixed ASAP so I don't have to use this workaround.

GulliblePsychologist avatar Nov 12 '20 23:11 GulliblePsychologist

This is critical

xgdgsc avatar Nov 19 '20 03:11 xgdgsc

I wouldn't know about that, but it is pretty annoying and it seems like this would be trivial to fix for someone who is familiar with the project.

GulliblePsychologist avatar Nov 19 '20 16:11 GulliblePsychologist

Still present in the latest version (3.7.0)

rc rc2

If we remove the block for "image/svg+xml" by clearing the "Blocked Media Types" field, then py-files can be uploaded, otherwise not. That seems to be a bug.

BjoernLudwig avatar Nov 25 '20 13:11 BjoernLudwig

Also hpp file doesn' t work.

xgdgsc avatar Jan 12 '21 04:01 xgdgsc

I could find out where the problem is. In the source code under packages/meteor-jalik-ufs/ufs-mime.js is a list of datatypes. After some testing, I got to the conclusion that every type in there can be sent without getting blocked

dieser-niko avatar Jan 26 '21 10:01 dieser-niko

I could find out where the problem is. In the source code under packages/meteor-jalik-ufs/ufs-mime.js is a list of datatypes. After some testing, I got to the conclusion that every type in there can be sent without getting blocked

Well done! Does that mean, we only have to include the file-endings which we desire to share? Or is that accompanied with any undesired side-effects?

BjoernLudwig avatar Jan 26 '21 10:01 BjoernLudwig

I guess so, but I cannot assure you that this will work because I'm not very experienced with javascript

dieser-niko avatar Jan 27 '21 12:01 dieser-niko

It looks as if the problem has been fixed in 3.11.1 (or 3.11.0)

rmaksimov avatar Feb 15 '21 07:02 rmaksimov

Not fixed in 3.18.0 https://github.com/RocketChat/Rocket.Chat/issues/23173

noobbbbb avatar Nov 19 '21 06:11 noobbbbb

This extremely annoying bug has been frustrating people for 3 years now. It seems that it should be trivial to fix. Is there any reason to not fix this?

jamesavery avatar May 15 '22 12:05 jamesavery

This is still an issue with 6.6.2. A workaround is to suffix all rejected files with .txt, or .zip.

oyxnaut avatar Mar 11 '24 10:03 oyxnaut

Seems it was working fine in 6.5.x. In my chat history I successfully sent someone a .csr file a couple months ago. Now in (currently) 6.6.6 the chat is rejecting such files.

meck-gd avatar Apr 05 '24 13:04 meck-gd

Just checking in to say it seems to work as expected with 6.10.0.

oyxnaut avatar Jul 12 '24 14:07 oyxnaut

working as expected with v6.13.0

noobbbbb avatar Oct 16 '24 07:10 noobbbbb