我正在使用ng-file-upload我正在尝试上传图像或 pdf 文件。我创建了带有文件输入的简单表单,但它只接受 pdf 文件。如果我将顺序更改为 'image/*, .pdf'
它只接受图像,但不接受 pdf。我如何接受图像和 pdf 文件?
<input type="file" ngf-select ng-model="picFile" name="file" ngf-pattern="'.pdf, image/*'" accept="'.pdf, image/*'" ngf-accept="'.pdf, image/*'" ngf-max-size="2MB" required ngf-model-invalid="errorFile">
最佳答案
应删除逗号后的空格ngf-pattern="'.pdf, image/*'"
关于javascript - 具有多种模式的 ng-file-upload,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47925814/