0

I have a form which contains name, email, and user's image for a web app registration. I send data via a REST API with $http in an object called userData. How can I add to this object the file / image? How to use angular model or bind the file to a scope variable?

Thanks in advance.

4
  • An answer to a question I've asked: Pre-Populate HTML form file input Commented Nov 25, 2015 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 . Commented Nov 25, 2015 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? Commented Nov 25, 2015 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 . Commented Nov 26, 2015 at 8:49

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.