1

What is the best practices in angularjs when submitting file without a submit button. Here is my sample code.

<form method="post" enctype="multipart/form-data" action="">
   <input type="file" name="file">
</form>

I already tried using onchange, very useful also but what i want is after selecting a file it will make an ajax call (without submit button).

4
  • I think this could be interesting for you: stackoverflow.com/a/26711257/1281305 Commented Feb 11, 2016 at 7:12
  • 1
    Don't try to reinvent the wheel. There are some cool libraries for this purpose like ng-file-upload as the first example. Commented Feb 11, 2016 at 7:18
  • Just make a post request with form data, 5 lines of code. No need for fancy library if you just want to upload the file. Commented Feb 11, 2016 at 7:32
  • ng-file-upload is so powerfull.. Thank you so much for your help... cheers. Commented Feb 11, 2016 at 8:17

1 Answer 1

1

i have used ngpload module for it.

ngpload

please refer the document from the link this will definitely help you a lot

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.