[英]Can't download blobs inside a folder using Node.js SDK
I'm trying to download some blobs in a blob container in azure. 我正在尝试在azure的blob容器中下载一些blob。
I have success when the file its on the root container, but not when is inside a folder. 当文件放在根容器中时,我成功了,但是当它在文件夹中时,我没有成功。
const folder = 'AZURE_FOLDER';
const filesToDownload = [ 'icon.ico', 'images/cover.jpg', 'images/htmlstructure.png' ]
filesToDownload.forEach(blob => {
service.download(containerName, blob, `${folder}/${blob}`)
});
Running this code, the downloaded file is 'icon.ico', but all others I receive this error: 运行此代码,下载的文件为“ icon.ico”,但所有其他我收到此错误:
error : { Error: ENOENT: no such file or directory, open 'AZURE_FOLDER/images/cover.jpg'
错误:{错误:ENOENT:没有这样的文件或目录,请打开'AZURE_FOLDER / images / cover.jpg'
error : { Error: ENOENT: no such file or directory, open 'AZURE_FOLDER/images/htmlstructure.png'
错误:{错误:ENOENT:没有这样的文件或目录,请打开'AZURE_FOLDER / images / htmlstructure.png'
BlobResult {
name: 'images/cover.jpg',
creationTime: 'Wed, 03 Apr 2019 17:14:03 GMT',
lastModified: 'Wed, 03 Apr 2019 17:14:03 GMT',
etag: '0x8D6B857C5B2B355',
contentLength: '299040',
contentSettings:
{ contentType: 'image/jpeg',
contentEncoding: '',
contentLanguage: '',
contentMD5: 'JqJRnPltEsAhar+YfKgEtQ==',
cacheControl: '',
contentDisposition: '' },
blobType: 'BlockBlob',
accessTier: 'Hot',
accessTierInferred: true,
lease: { status: 'unlocked', state: 'available' },
serverEncrypted: 'true' }
BlobResult {
name: 'images/htmlstructure.png',
creationTime: 'Wed, 03 Apr 2019 17:14:02 GMT',
lastModified: 'Wed, 03 Apr 2019 17:14:02 GMT',
etag: '0x8D6B857C4ECA732',
contentLength: '65835',
contentSettings:
{ contentType: 'image/png',
contentEncoding: '',
contentLanguage: '',
contentMD5: 'uHsFKqK9csssX0XYt86dlA==',
cacheControl: '',
contentDisposition: '' },
blobType: 'BlockBlob',
accessTier: 'Hot',
accessTierInferred: true,
lease: { status: 'unlocked', state: 'available' },
serverEncrypted: 'true' }
BlobResult {
name: 'user.ico',
creationTime: 'Wed, 03 Apr 2019 16:58:24 GMT',
lastModified: 'Wed, 03 Apr 2019 16:58:33 GMT',
etag: '0x8D6B8559B5CC9C8',
contentLength: '179677',
contentSettings:
{ contentType: 'image/x-icon',
contentEncoding: '',
contentLanguage: '',
contentMD5: 'sHZ3nvd9fyX09EkqQvDvLQ==',
cacheControl: '',
contentDisposition: '' },
blobType: 'BlockBlob',
accessTier: 'Hot',
accessTierInferred: true,
lease: { status: 'unlocked', state: 'available' },
serverEncrypted: 'true' }
Does the AZURE_FOLDER/images
directory exist? AZURE_FOLDER/images
目录是否存在? If not, you will need to create it using the fs
module beforehand. 如果不是,则需要预先使用
fs
模块创建它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.