[英]Azure Storage Blob Content type Converter
I need to convert approx 250k images from having a content type of application/octetstream to image/jpg 我需要将内容类型为application / octetstream的大约250k图像转换为image / jpg
is there a powershell script I can utilise to do this or some sort of command code? 我可以利用Powershell脚本来执行此操作或某种命令代码吗?
I don't think Windows Azure PowerShell Cmdlets has a readymade Cmdlet to do that. 我认为Windows Azure PowerShell Cmdlet没有现成的Cmdlet可以做到这一点。 If you're open to use 3rd party product, you can try Cerebrata's Azure Management Cmdlets
. 如果您愿意使用第三方产品,可以尝试使用Cerebrata's Azure Management Cmdlets
。 It has a Set-BlobProperties
cmdlet using which you can set the content type. 它具有Set-BlobProperties
cmdlet,可使用该cmdlet设置内容类型。
You can also do it through code as well. 您也可以通过代码来实现。 Essentially what you would do is fetch blobs from the blob container using ListBlobs
or ListBlobsSegmented
method and then iterate over these blobs and update the blob's properties via SetProperties
method of CloudBlockBlob. 本质上,您要做的就是使用ListBlobs
或ListBlobsSegmented
方法从Blob容器中获取Blob,然后遍历这些Blob并通过CloudBlockBlob的SetProperties
方法更新Blob的属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.