how to preview images previously uploaded to the server?

741 views Asked by At

I am using ng-file-upload and I want to know how to show images which were uploaded previously to the server using ngf-thumbnail?

1

There are 1 answers

0
VadimB On

ng-file-upload really great angular plugin to work with files. Also it has really good documented.

After adding control to process files:

<div ngf-drop="" ng-model="files" ngf-model-options="modelOptionsObj" ngf-multiple="multiple" ngf-pattern="'image/*'" ... />

You can access this files to show in preview using ngf-src directive

      <div class="preview">
        <img ngf-src="!files[0].$error && files[0]">
      </div>

For better understanding and more behaviors supported by this plugin please follow this demo link

https://angular-file-upload.appspot.com/