角和文件上传 [英] Angular and file upload

查看:129
本文介绍了角和文件上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这种情况。
请上传具有角上传文件文件的请求:

I have this situation. Make a request to upload file with angular-upload-file:

var onBeforeUploadItem = function(item) {
item.formData.push({test:'test'});
        };

        var _emptyQueue = function(){
            $scope.uploader.clearQueue();
            $scope.uploader.formData = [];
        };

        var onAfterAddingAll = function(addedFileItems) {
            $scope.uploader.uploadAll();
        };

        var _initUploader = function(){

            $scope.uploader =  new FileUploader({
                url: (restServiceUrl),
                isHTML5 : true
            });
            $scope.uploader.onBeforeUploadItem = onBeforeUploadItem;
            $scope.uploader.onAfterAddingAll = onAfterAddingAll;

            _emptyQueue();
        };

请求包含文件,但列表项= upload.parseRequest(service.getHttpServletRequest())是空的。
帮我! :)

The request contain the file but List items = upload.parseRequest(service.getHttpServletRequest()) is empty. Help me! :)

推荐答案

伍输入文件是不允许使用的NG-模式。

Ng input file is not allowed for use ng-model.

不提供的所有功能适用于所有输入类型。具体来说,数据绑定和事件通过NG-处理模式不支持输入[文件]

Not every feature offered is available for all input types. Specifically, data binding and event handling via ng-model is unsupported for input[file].

详细

您可以采取的文件路径并与jQuery文件上传功能的使用。

You can take file path and use with Jquery File Upload functions.

这将帮助你:
文件上传使用AngularJS

这篇关于角和文件上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆