目前我的代码是:$scope.upload = function (file) {
Upload.upload( {
url: ' ',
fields: {'username': $scope.username},
file: file
})
.progress(function (evt) {
var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);
// alert('progress: ' + progressPercentage + '% ' + evt.config.file.name);
})
.success(function (data, status, headers, config) {
// alert(000000);
// alert('file ' + config.file.name + 'uploaded. Response: ' + ' congig======='+config.sites);
//添加文件
vm.addjson(file);
})
.error(function (data, status, headers, config) {
alert('error status: ' + status);
vm.addjson(file);
})
};
有以下问题:1:url该写什么,现在不管写什么都报404
2:这段代码能获取到file对象但是保存不到本地阿。没有实际的保存到本地的功能,这是主要问题
希望大牛们能帮忙解答