Open zbagley opened 5 years ago
Any progress?
Some Mime types not recognized, like for example .asc
should be text/plain
but instead it shows empty string. Then easier is to write method in addedToQueue
upload case and then check file extensions, before pushing in upload files list:
case 'addedToQueue':
let extension = this.file.name.split('.')[1];
if (this.allowedFileExtensions.indexOf(extension) === -1) {
this.notification.danger('notifications.only-cypher-files');
return;
}
this.files.push(output.file);
break;
Description
Currently
allowedContentTypes
for input options only seems to accept very specific MIME types. The expected results would be that theallowedContentTypes
array would match how a DOM<input accept="<allowedContentTypes>"
performs.Specific Issues
Noticed mismatch on: blanket MIME types (
image/*
,audio/*
) specific extensions (.dae
,.dxf
)Reproduction
Using the demo .ts and .html files, append options to include:
allowedContentTypes: ['image/*', '.dae']
This results in the input rejecting all image files and .dae extension files.
Append
<input accept="image/*, .dae" />
and image files and .dae extensions are no longer rejected, but are the only files allowed to be selected for upload.