- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 Amazon AWS 和 Glacier 的新手。我正在尝试编写一个基于 WPF Windows 的 C# 客户端,将我的存档备份数据上传到冰川云。但是,API 引用似乎没有提供取消命令。仅上传、下载、列表。
我想做的是使用 TPL 异步运行每个上传操作(对于大文件可能需要 1 小时或更长时间)。但是我希望上传是可取消的,.NET 4.5 会很好地支持,但 Amazon API 不支持。
有没有办法做到这一点?
谢谢。
最佳答案
在 Amazon Glacier 中处理您的场景的推荐方法(还有 Amazon S3 顺便说一句。)是通过分段上传分段上传文件,参见Uploading an Archive in Amazon Glacier :
Depending on the size of the data you are uploading, Amazon Glacier offers the following options:
Uploading Large Archives in Parts (Multipart Upload) — In a single operation, you can upload archives from 1 byte to up to 4 GB in size. However, we encourage Amazon Glacier customers to use Multipart Upload to upload archives greater than 100 MB. [...] [emphasis mine]
Upload archives in parts — Using the Multipart upload API you can upload large archives, up to about 40,000 GB (10,000 * 4 GB).
Uploading Large Archives in Parts (Multipart Upload)提供有关后者的详细信息,特别是关于完成(或中止)分段上传:
After uploading all the archive parts, you use the complete operation. [...]
If you abort a multipart upload, you cannot upload any more parts using that multipart upload ID. All storage consumed by any parts associated with the aborted multipart upload is freed. If any part uploads were in-progress, they can still succeed or fail even after you abort. [emphasis mine]
因此,您仍然无法中止正在上传的部分,因此,获得所需用户体验和/或减少网络带宽的关键是选择足够小的部分大小。
根据您的用例,您可能还想查看 List Multipart Uploads (GET multipart-uploads) :
This multipart upload operation lists in-progress multipart uploads for the specified vault. An in-progress multipart upload is a multipart upload that has been initiated by an Initiate Multipart Upload (POST multipart-uploads) request, but has not yet been completed or aborted. [...]
关于c# - 如何在 .NET C# 中取消长时间运行的 Amazon Glacier 文件上传操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12560345/
我有以下正则表达式 /[a-zA-Z0-9_-]/ 当字符串只包含从 a 到z 大小写、数字、_ 和 -。 我的代码有什么问题? 能否请您向我提供一个简短的解释和有关如何修复它的代码示例? //var
我是一名优秀的程序员,十分优秀!