【发布时间】:2019-09-19 11:58:06
【问题描述】:
我需要读取上传到 AWS S3 存储桶中的文本文件的内容。我有位于 S3 存储桶中的文件的 URL。有人可以帮我阅读使用 S3 URL 的文本文件内容。
我知道我们可以使用 ResponseStream 读取数据,但想使用 URL/路径读取它。我需要使用 .NET Core 创建 AWS Lambda 服务。下面的代码突出显示了如何使用 ResponseStream 读取它
using (GetObjectResponse response = await _client.GetObjectAsync(requestGet))
using (Stream responseStream = response.ResponseStream)
using (StreamReader reader = new StreamReader(responseStream))
【问题讨论】:
-
为什么不使用AWS SDK来获取对象呢?
标签: amazon-web-services amazon-s3 .net-core aws-lambda