我正在我的数据库中搜索一个字节数组的图像。我想使用标记图像将此内容显示为文件,但它在这里不起作用。
// Controller which get my image and put into $scope.
function MyController($scope, $http, $location) {
var url = '/json/FindImage?id=1';
$http.get(url).success(function(result) {
$scope.image = result.Image;
}
我正在使用Alamofire检索URL图像列表。响应在JSON中,我使用SwiftyJSON来解析和打印每个元素。我希望URL被添加到URL数组中。下面是我使用的代码
var newArray = [URL(string: "http://www.tummyvision.com/users/uploads/gijovarghese141@gmail.com/photos/4.jpg")]
Alamofire.request("http://www.tummyvision.com/users/login/get-images.php", para
我有本地图像URL,我想从它获得blob。
我发现的唯一方法是在本地URL上执行HTTP请求'get‘,然后读取返回的blob……但这是一种很奇怪的方式。
使用HTTP的代码片段:
function readBody(xhr) {
var data;
if (!xhr.responseType || xhr.responseType === "text") {
data = xhr.responseText;
} else if (xhr.responseType === "document") {
通过使用python代码,我尝试从json文件中读取数据,并通过API上传数据。然而,我得到了HTTP错误5000。以下是我的代码:
url = 'http://sipdev1.vbi.vt.edu:8080/EpiViewer/epiviewer/services/uploadGraphData'
for i in json_file_name:
json_data = open (i, 'r')
lines=json_data.readlines()
req = url