本文介绍了角和文件上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这种情况。请上传具有角上传文件文件的请求:
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
更多推荐
角和文件上传
发布评论