Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error uploading file when mime type is undefined and size < 10mb. #6917

Closed
millerlucas opened this issue May 9, 2017 · 0 comments · Fixed by #6935
Closed

Error uploading file when mime type is undefined and size < 10mb. #6917

millerlucas opened this issue May 9, 2017 · 0 comments · Fixed by #6935
Assignees
Milestone

Comments

@millerlucas
Copy link

millerlucas commented May 9, 2017

Rocket.Chat Version: 0.55.1
Running Instances: 1
DB Replicaset OpLog: Disabled
Node Version: v4.8.1

Upload fail when the file type is not recognized by browser and the size is lower than 10 mb.

Uncaught TypeError: Cannot read property 'indexOf' of undefined
    at r (https://chat.teamto.fr/3ddab15a0c8874398ba3db26458f5d286c68a2ef.js?meteor_js_resource=true:260:14377)
    at i (https://chat.teamto.fr/3ddab15a0c8874398ba3db26458f5d286c68a2ef.js?meteor_js_resource=true:260:15133)
    at fileUpload (https://chat.teamto.fr/3ddab15a0c8874398ba3db26458f5d286c68a2ef.js?meteor_js_resource=true:260:18133)
    at Object.dropped .dropzone-overlay (https://chat.teamto.fr/3ddab15a0c8874398ba3db26458f5d286c68a2ef.js?meteor_js_resource=true:264:1461)
    at Object.o.(anonymous function) (https://chat.teamto.fr/3ddab15a0c8874398ba3db26458f5d286c68a2ef.js?meteor_js_resource=true:258:620)
    at https://chat.teamto.fr/3ddab15a0c8874398ba3db26458f5d286c68a2ef.js?meteor_js_resource=true:130:6128
    at Function.e._withTemplateInstanceFunc (https://chat.teamto.fr/3ddab15a0c8874398ba3db26458f5d286c68a2ef.js?meteor_js_resource=true:130:5707)
    at h.View.<anonymous> (https://chat.teamto.fr/3ddab15a0c8874398ba3db26458f5d286c68a2ef.js?meteor_js_resource=true:130:6080)
    at https://chat.teamto.fr/3ddab15a0c8874398ba3db26458f5d286c68a2ef.js?meteor_js_resource=true:129:27045
    at Object.h._withCurrentView (https://chat.teamto.fr/3ddab15a0c8874398ba3db26458f5d286c68a2ef.js?meteor_js_resource=true:129:23116)

The error come from the file rocketchat-ui/client/lib/fileUpload.coffee line 13, file.file.type is undefined.

I think maybe we should avoid trying to preview the file in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants