Azure file downloads

This commit is contained in:
richard-dds
2019-08-06 11:54:43 -04:00
parent 094e44a6b0
commit b182307174
4 changed files with 47 additions and 4 deletions

View File

@@ -43,6 +43,14 @@ class AzureUploader {
fileReader.readAsText(file)
})
}
downloadUrl(objectName) {
const blobService = Azure.createBlobServiceWithSas(
`https://${this.accountName}.blob.core.windows.net`,
this.sasToken
)
return blobService.getUrl(this.containerName, objectName, this.sasToken)
}
}
class AwsUploader {
@@ -58,6 +66,7 @@ class AwsUploader {
})
form.append('file', file)
form.set('x-amz-meta-filename', file.name)
form.set('Content-Type', 'application/pdf')
const response = await fetch(this.presignedPost.url, {
method: 'POST',