在上传文档时,如何在ng-file-upload中获得不支持文档的其他条件


 <button class="bx--btn full-width" type="button" type="file" ngf-select="vm.uploadFiles($files)" ngf-multiple="true"
    ngf-allow-dir="true" ngf-pattern=".pdf,.docx,.xlsx" multiple accept=".pdf,.docx,.xlsx" ngf-max-size="50 MB"
    id="browse-RFPdoc">Upload New Documents</button>

目前在我的html中,我一直在使用指令ngf-pattern来指定要上传的文件格式。...如果我选择不支持格式很好(。

我需要知道如果我上传不支持的文件,我该如何获得其他语句。

如果我试图上传不支持的文档格式,我需要在此指令中获得标志或想法

您可以通过使用 ngf-model-invalid =" vm.invalidfiles" 来获取有关所有无效文件上传的信息。这些可能是不支持格式或其他错误。然后,您可以通过直接访问vm.invalidfiles

来显示摘要中的错误
<div>{{vm.invalidFiles}<div>

可以在此处找到有关验证的更多信息:https://github.com/danialfarid/ng-file-upload

最新更新