0

I have a form wich contain name, email... and user's image for a web app registration, i send data via a rest api with $http in a objet called userData, how ca i add to this objet the file / image ? how to use angular model or bind the file to a scope variable ?

Thanx in advance.

Nacim Idjakirene
  • 1,882
  • 8
  • 26
  • 45
  • An answer to a question I've asked: [Pre-Populate HTML form file input](http://stackoverflow.com/questions/16365668/pre-populate-html-form-file-input#answer-16367121) – Luigi Siri Nov 25 '15 at 21:21
  • its not about prepopulating the image, it is the user who will do it, its about binding uploaded file to a ng-model . – Nacim Idjakirene Nov 25 '15 at 21:41
  • 1
    didnt get it, do you want to send the file to the server? do you want to upload to s3? what do you want to do? – Jony-Y Nov 25 '15 at 22:09
  • @Jony-Y i want to send the file to my server ( laravel backend ), but i would like to send it in the same objet with the other input element (name, lastname, tel, email..etc) but ng-model does not work with file input . – Nacim Idjakirene Nov 26 '15 at 08:49

1 Answers1

1

I use ng-file-upload: https://github.com/danialfarid/ng-file-upload

It works well with images and supports uploading by drag and drop, multiple files etc.

Fredrik Holm
  • 166
  • 9