Tag: blobstorage

批量上载大量图像到Azure Blob存储

我有大约110,000张各种格式的图像(jpg,png和gif)和大小(2-40KB)本地存储在我的硬盘上。 我需要将它们上传到Azure Blob存储。 在执行此操作时,我需要设置一些元数据和blob的ContentType,否则它是直接批量上传。 我目前正在使用以下内容来处理一次上传一个图像(并行超过5-10个并发任务)。 static void UploadPhoto(Image pic, string filename, ImageFormat format) { //convert image to bytes using(MemoryStream ms = new MemoryStream()) { pic.Save(ms, format); ms.Position = 0; //create the blob, set metadata and properties var blob = container.GetBlobReference(filename); blob.Metadata[“Filename”] = filename; blob.Properties.ContentType = MimeHandler.GetContentType(Path.GetExtension(filename)); //upload! blob.UploadFromStream(ms); blob.SetMetadata(); blob.SetProperties(); } } 我想知道是否还有其他技术可以用来处理上传,以尽可能快地完成。 此特定项目涉及将大量数据从一个系统导入另一个系统,并且出于客户原因,它需要尽快发生。