File Upload using AngularJS

前端 未结 29 2037
野趣味
野趣味 2020-11-21 07:24

Here is my HTML form:

29条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-21 08:18

    i think this is the angular file upload:

    ng-file-upload

    Lightweight Angular JS directive to upload files.

    Here is the DEMO page.Features

    • Supports upload progress, cancel/abort upload while in progress, File drag and drop (html5), Directory drag and drop (webkit), CORS, PUT(html5)/POST methods, validation of file type and size, show preview of selected images/audio/videos.
    • Cross browser file upload and FileReader (HTML5 and non-HTML5) with Flash polyfill FileAPI. Allows client side validation/modification before uploading the file
    • Direct upload to db services CouchDB, imgur, etc... with file's content type using Upload.http(). This enables progress event for angular http POST/PUT requests.
    • Seperate shim file, FileAPI files are loaded on demand for non-HTML5 code meaning no extra load/code if you just need HTML5 support.
    • Lightweight using regular $http to upload (with shim for non-HTML5 browsers) so all angular $http features are available

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

提交回复
热议问题