ngx-uploader icon indicating copy to clipboard operation
ngx-uploader copied to clipboard

Add support to file extensions

Open AnaSofiaGrilo96 opened this issue 6 years ago • 1 comments

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!

AnaSofiaGrilo96 avatar Apr 20 '18 10:04 AnaSofiaGrilo96

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

nobady90 avatar May 21 '18 12:05 nobady90