Angularjs 从angular js下载图像
我从MongoDB得到图像。现在我想通过代码将图像下载到我的系统中 从这段代码中,我得到了以下对象: $scope.clickEvent=函数(x){ Bt我下载的东西是:Angularjs 从angular js下载图像,angularjs,web,Angularjs,Web,我从MongoDB得到图像。现在我想通过代码将图像下载到我的系统中 从这段代码中,我得到了以下对象: $scope.clickEvent=函数(x){ Bt我下载的东西是: 尝试将内容类型标题和响应类型添加到“blob” $http({ method: 'GET', url: $API_URL + path, headers: { 'Content-Type': 'image/jpg', //content type set to image
尝试将
内容类型
标题和响应类型
添加到“blob”
$http({
method: 'GET',
url: $API_URL + path,
headers: {
'Content-Type': 'image/jpg', //content type set to image
'Authorization': $localStorage.currentUser.token
},
responseType: 'blob'
})
我知道答案了,谢谢。
$http({
method: 'GET',
url: $API_URL + path,
headers: {
'Content-Type': 'image/jpg', //content type set to image
'Authorization': $localStorage.currentUser.token
},
responseType: 'blob'
})