Unable to set allowedMimeType to application/csv or text/csv #728
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When I want to restrict to upload only the CSV file the current code doesn't let me to do so. It always fire onWhenAddingFileFailed in case of "application/csv". Any help appreciated
Hi,
As I can see, there is no support for text/csv mime type.
But you can create your own file type filter:
this.uploader = new FileUploader({
url: URL,
filters: [{
name: 'extension',
fn: (item: any): boolean => {
const fileExtension = item.name.slice(item.name.lastIndexOf('.') + 1).toLowerCase();
return fileExtension === 'csv' ;
}
}]
});
I have used allowedMimeTypes as follows, It worked for me.