ngx-uploader
ngx-uploader copied to clipboard
Add support to file extensions
Hello,
I'm using the latest version of the ngx-uploader (4.2.4) and I was wondering if you have in mind adding support to restrict the file extensions, as it is already implemented with content types.
I think content types are more limited, because two different file extensions can have the same content type.
As an example, and you can test it in the component, if you upload a .xlx file and a .csv file, the will have the same content type.
Thanks in advance!
if I understand correctly you want to limit the upload only to particular file extensions?
I have just solved by declaring the variable 'options' in the affected component:
this.options = {concurrency: 0, allowedContentTypes: ['image / png']};
instead of 'image / png' you can enter the types of file extensions you are interested in, the complete list can be found here: Wiki MIME
Now instead I'm looking for how to see only the files with the correct extension in the selection window, I've already added accept = ". png"
but the window shows both png and unknown (so all the files)
I hope this will help you :-D