原文技术交流:http://www.ncloud.hk/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/angularjs-ng-file-upload/
在做网站的过程中难免会遇到上传图片或者上传文件的功能,使用AngularJ实现的话可以用angularJs的ng-file-upload这个库。
支持上传文件(目前为止我用过的是Excel上传,与上传图片的方法一样)支持单张图片上传支持多张图片上传支持拖拽图片上传
1.Install安装引用
手册:可以从这里下载最新的js库Bower安装:bower install ng-file-upload-shim --save
(for non html5 suppport)
bower install ng-file-upload --saveNuGet:PM> Install-Package angular-file-uploadNPM:npm install ng-file-upload
2.Usage用法
(1)Single image upload
(2)Multiple images upload
(3)Drop Singleimage
(4)Drop and Select Multiple images upload
以上内容是我做项目中需要的一些功能,也许不是该库全面的功能,若有其他需求可以查看GitHub官方文档:/danialfarid/ng-file-upload