【发布时间】:2018-03-16 09:40:49
【问题描述】:
我尝试在功能下载运行时自动下载视频。 我正在尝试使用 saveAs(fileSaver.js) 但出现错误
在“URL”上执行“createObjectURL”失败:找不到函数 与提供的签名相匹配。
任何人都可以提供帮助。
$scope.download = function(){
var fd = new FormData();
angular.forEach($scope.files, function(video){
fd.append('video', video);
});
var request = $http({
method : 'POST',
url: xxxx + 'video/upload?start=' + $scope.start + '&end=' + $scope.end,
data : fd,
transformRequest:angular.identity,
headers:{'Content-Type':undefined}
});
request.then(function(response){
saveAs(response , 'video.mp4');
$scope.isProcessing = false;
}, function(error){
$scope.isProcessing = false;
});
}
在服务端我使用烧瓶将返回如下:
return send_file(app.root_path + '/' + app.config['UPLOAD_FOLDER'] + '/uploadV/dd.mp4', as_attachment=True)
【问题讨论】:
标签: javascript angularjs