[英]ng-file-upload with several patterns
我正在使用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/*'"
嘗試使用以下代碼上傳圖片和pdf文件。
ng-accept="'.pdf,.jpg'|validate($file)"
對於多個文件,您必須將ng-multiple設置為true
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.