Specific file types/sizes #260

Open
opened 2016-06-14 18:48:18 +00:00 by GhazalAghvami · 2 comments
GhazalAghvami commented 2016-06-14 18:48:18 +00:00 (Migrated from github.com)

Does anyone know how I can only allow specific file types and/or sizes to be uploaded?
Thanks!

Does anyone know how I can only allow specific file types and/or sizes to be uploaded? Thanks!
t246246 commented 2016-06-18 02:14:16 +00:00 (Migrated from github.com)

Do something like this:

ngOnInit() {
    this.uploader.setOptions({
        url: URL,
        filters: [{fn: item => {
            return item.size < 1024 * 1024 && item.type === 'text/plain';
        }}]
    });
}
Do something like this: ``` javascript ngOnInit() { this.uploader.setOptions({ url: URL, filters: [{fn: item => { return item.size < 1024 * 1024 && item.type === 'text/plain'; }}] }); } ```
GhazalAghvami commented 2016-06-20 16:50:51 +00:00 (Migrated from github.com)

Thank you !

Thank you !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#260