简体   繁体   English

不在C#目录中将多对象上传到Amazon S3

[英]Multi Object Upload to Amazon S3 not from directory in C#

I am aware of the TransferUtitlity class from the SDK but it would appear that only supports uploading large files from stream or multiple files via a hard disk. 我知道SDK中的TransferUtitlity类,但它似乎仅支持通过硬盘从流或多个文件上载大文件。 Is there a way to use TransferUtility or another set of the AWSSDK functions to upload/put multiple objects (in the form of 'strings') to S3 using the built-in optimizations of the TransferUtility class? 有没有一种方法可以使用TransferUtility或另一组AWSSDK函数通过TransferUtility类的内置优化功能将多个对象(以“字符串”的形式)上载/放置到S3?

To give an example, say I have 1000 string "contents" in an array and would like each of those to become an object in s3 with their own key. 举个例子,假设我在数组中有1000个字符串“内容”,并希望它们中的每一个都使用自己的键成为s3中的对象。 What is the more efficient way to upload these objects as a group? 将这些对象成组上传的更有效方法是什么?

After further researching this issue and playing around with a variety of approaches, the quickest way to upload a bunch of (non huge) files to s3 was to use the TPL and parallel.foreach for each of the files to be uploaded. 在进一步研究了这个问题并尝试了多种方法之后,将一堆(非巨大的)文件上传到s3的最快方法是对每个要上传的文件使用TPL和parallel.foreach。 This resulted in the quickest upload time. 这导致最快的上载时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM