I need one help.I need to upload the file and display the validation message using ng-file-upload in Angular.js
.I am explaining my code below.
<div ng-class="{'myError': billdata.regdoc.$touched && billdata.regdoc.$invalid }">
<input type="file" class="filestyle form-control" data-size="lg" name="regdoc" id="regdoc" ng-model="regfile" ngf-pattern="'image/*'" accept="image/*" ngf-max-size="20MB" ngf-min-height="100" ngf-resize="{width: 100, height: 100}" custom-on-change="uploadFile" required="required" ngf-select="onRegFileSelect($regfile);" >
</div>
Now,this filed is allowing the image only.But here i need this field should allow only pdf,ppt and .docx
files.If any other file will upload the validation message should display.Please help me.
ng-pattern
in the github repo – feniixx Dec 28 '15 at 6:31ngf-pattern="'.pdf,.ppt,.docx'" ngf-accept="'.pdf,.ppt,.docx'"
– danial Dec 28 '15 at 7:02ngf-pattern="application/pdf,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.wordprocessingml.document" accept="application/pdf,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.wordprocessingml.document"
this. – satya Dec 28 '15 at 7:54