MatheusrdSantos / vue-quick-chat

A simple chat component created with Vue.js
MIT License
128 stars 45 forks source link

[new Feature] Image upload -> customize file types :-) #37

Closed martinandersen3d closed 4 years ago

martinandersen3d commented 4 years ago

It would be nice to be able to customize what files types, the user can upload. Since the server maybe only support jpg/png or something else :D

Docs:

https://www.w3schools.com/tags/att_input_accept.asp

Code:

https://github.com/MatheusrdSantos/vue-quick-chat/blob/8b9e21878b140c0312cfd3357da4b6b9176afeca/src/components/MessageManager.vue#L12

All the file formats that the browser (chrome) suggest on windows:

image

And again, thanks for a awesome component ;-) ;-) ;-)

MatheusrdSantos commented 4 years ago

Hi, @martinandersen3d! This feature is part of a greater implementation. To accept other files format we need a way to display the file. I'll implement a way to choose which image types are allowed. But this approach may change when implementing file upload support.

Thanks again

MatheusrdSantos commented 4 years ago

@martinandersen3d, now you can set the accept attribute. Update to version 1.2.5 and read the docs about acceptImageTypes.