我正在尝试将图像转换为字节数组。下面是我返回该图像的base64string的代码:
$scope.imageAdded = function (files) {
angular.forEach(files,
function (flowFile, i) {
var fileReader = new FileReader();
fileReader.onload = function (event) {
var uri = event.target.result;
$scope.imageStrings[i] = uri;
};
fileReader.readAsDataURL(flowFile.file);
event.preventDefault(); //prevent file from uploading
});
}
任何形式的帮助都将不胜感激
2条答案
按热度按时间eqoofvh91#
试试这个
6ss1mwsb2#