Uploading File in AngularJS without submit button

血红的双手。 提交于 2020-01-16 05:25:07

问题


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).


回答1:


i have used ngpload module for it.

ngpload

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



来源:https://stackoverflow.com/questions/35332886/uploading-file-in-angularjs-without-submit-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!