亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

angular.js - How to read a byte array from an image path in Angular?
伊謝爾倫
伊謝爾倫 2017-05-15 16:52:34
0
1
1250

As mentioned
Get one now

file:///var/mobile/Containers/Data/xxxx.jpg

The images that need to be added with this path are read into byte arrays and passed to the server. How should this be achieved?

PS:
Try using $http to read this file

$http.get('file:///var/mobile/Containers/Data/xxxx.jpg')
.success(function(response) {
    alert(response);
});

I don’t know what the response read here is?

伊謝爾倫
伊謝爾倫

小伙看你根骨奇佳,潛力無限,來學(xué)PHP伐。

reply all(1)
大家講道理

The following method can convert the requested image result into blob. As for how you want to use it afterwards, it’s up to you

$http.get('http://localhost:9000/test.png')
    .success(function(data) {
        var blob = new Blob([data], {
            type: 'image/png'
        });
        console.log(blob);
    });

I only tried the method of serving images on the server. I don’t know if it will work if you load local images. Because of the content-typeimage/png in the response header of the server’s serve image, I don’t know what’s going on when loading local files

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template