I am using the Angular File Uploader library in Angular JS. Here is filtersone that allows you to set file types for download. I do it like:
uploader.filters.push({
name: 'imageFilter',
fn: function (item /*{File|FileLikeObject}*/, options) {
var type = '|' + item.type.slice(item.type.lastIndexOf('/') + 1) + '|';
return '|doc|txt|docx|xml|pdf|djvu'.indexOf(type) !== -1;
}
});
The problem is that the user can change the extension file, for example, change *.exeto *.pdf, and after Angular, the loader will add the file to the download queue.
And how can I show the information in the template where the PDF and txt files are?
Hamed source
share