Vikram Pote Vikram Pote - 5 months ago 62
AngularJS Question

Angular js ng-file-upload not working on ipad

I am using ng-file-upload to upload image in my meanjs application.
It works in ubuntu browser and mac browser but when i tested it on ipad it does't work.

Is there any solution for this issue?


<img class="img-thumbnail" ngf-src="file" ngf-resize="{width: 100, height: 100, quality: 0.9}" ngf-no-object-url="true" >
<div class="btn btn-primary button" ngf-select ng-model="file" name="file" ngf-pattern="'.jpg,.jpeg,.png'"
ngf-accept="'image/*'" ngf-max-size="2MB" ngf-min-height="650" ngf-min-width="900"
ngf-resize="{width: 1000, height: 650}" required>Browse Image
</div>
<span class="info-note" >Allowed File Dimension: 1000px * 650px, Allowed File Size: 2 MB, Allowed File Type: JPG, JPEG, PNG
</span>
<div ngf-thumbnail="file" ngf-size="{width: 20, height: 20, quality: 0.9}" ngf-as-background="boolean">
</div>


Answer

I just changed div to input with type file and it works on iPad also.

<img class="img-thumbnail" ngf-src="file" ngf-resize="{width: 100, height: 100, quality: 0.9}" ngf-no-object-url="true" > 
<input type="file" class="btn btn-primary button" ngf-select ng-model="file" name="file" ngf-pattern="'.jpg,.jpeg,.png'"
        ngf-accept="'image/*'" ngf-max-size="2MB" ngf-min-height="650" ngf-min-width="900" 
         ngf-resize="{width: 1000, height: 650}" required>Browse Image
</input>
<span class="info-note" >Allowed File Dimension: 1000px * 650px, Allowed File Size: 2 MB, Allowed File Type: JPG, JPEG, PNG
</span>
<div ngf-thumbnail="file" ngf-size="{width: 20, height: 20, quality: 0.9}" ngf-as-background="boolean">
</div>