首页 > 解决方案 > 例外:从“Amazon.Runtime.Internal.Util.MD5Stream”上的“位置”获取值时出错

问题描述

我正面临这个例外

Error getting value from 'Position' on 'Amazon.Runtime.Internal.Util.MD5Stream'.

尝试从 aws s3 存储桶读取文件时。

这是我的 C# 代码

    try
    {
    var s3ObjectPath = $"users/{email.Id}/emailattachments/{item.AttachedFileName}";
    var ifExists = await this.Exists(s3ObjectPath);
    if (ifExists)
    {
    Stream attachment = await s3Client.GetObjectStreamAsync(attachmentS3BucketName, s3ObjectPath, dicData);
    Attachment att = new Attachment(attachment, item.AttachedFileName);
    attachments.Add(att);
    }
    }
    catch (AmazonS3Exception ex)
    {

    }

然而,这有时是有效的。我到处搜索,但没有找到解决方案。

提前致谢!!

标签: c#asp.netamazon-web-servicesamazon-s3base64

解决方案


推荐阅读