ich den folgenden Code habe die Liste des Blobs (hochgeladene Dateien) meinen blob Container (benannt id
) zu erhalten:Get Azure Blob-Daten in JSON
app.controller("attachmentsController", ["$scope", "$http", function ($scope, $http) {
var ct = this;
$scope.go = function() {
ct.id = $scope.id;
var rootUrl = 'https://my-account.blob.core.windows.net';
var containerPropertiesUrl = `${rootUrl}/${ct.id}?restype=container`;
var blobListUrl = `${containerPropertiesUrl}&comp=list`;
// get container's blob list
$http.get(blobListUrl)
.then(function (response) {
ct.blobs = response.data;
});
};
}]);
Im response.data
I erhalten XML:
<?xml version="1.0" encoding="utf-8"?>
<EnumerationResults ContainerName="https://my-account.blob.core.windows.net/000002">
<Blobs>
<Blob>
<Name>logo-separator.svg</Name>
<Url>https://my-account.blob.core.windows.net/000002/logo-separator.svg</Url>
<Properties>
<Last-Modified>Fri, 25 Aug 2017 10:00:01 GMT</Last-Modified>
<Etag>0x8Y4EBAX0D5850C7</Etag><Content-Length>2048</Content-Length>
<Content-Type>application/octet-stream</Content-Type><Content-Encoding />
<Content-Language />
<Content-MD5>BDm9NV0Zn4e6zQO2e/D1Dg==</Content-MD5><Cache-Control />
<BlobType>BlockBlob</BlobType>
<LeaseStatus>unlocked</LeaseStatus>
</Properties>
</Blob>
</Blobs>
<NextMarker />
</EnumerationResults>"
Gibt es eine Möglichkeit, all das im JSON-Format zu bekommen, um es in meiner eckigen Anwendung verwenden zu können?
versuchen url Wechsel auf diese: var blobListUrl = '$ {containerPropertiesUrl} & comp = Liste & jsoncallback ='; –
Ich habe das OP bearbeitet, um zu erklären, dass ich keinen Blob-Inhalt lese, aber ich lese die Liste der Blobs (Dateien in meinem Fall) aus einem gegebenen Container – Serge