【发布时间】:2016-11-29 10:51:02
【问题描述】:
您好,我正在使用NgimgCrop,并且我成功获得了base64 图像现在我想使用http post 请求中的多部分表单数据发送它。
我的文件上传代码看起来像这样
scope.myCroppedImage = '';
$scope.uploadFile = function (file) {
if (file) {
// ng-img-crop
var imageReader = new FileReader();
imageReader.onload = function (image) {
$scope.$apply(function ($scope) {
$scope.myImage = image.target.result;
$scope.profileData.data = $scope.myImage;
console.log($scope.profileData.data);
});
};
imageReader.readAsDataURL(file);
}
};
有什么方法可以在 base64 之后将其转换为多部分 angular 吗?我尝试了各种链接,但没有任何效果。
【问题讨论】:
标签: angularjs image file upload ng-img-crop