我希望创建一个 python 进程来在运行时刷新临时 AWS 凭证(有效期为 30 分钟),以确保我的代码可以连续运行超过 30 分钟。
什么是 RefreshableCredentials 以及如何使用它?
我有一个 Web Api 控制器方法,可以获取传递的文档 ID,并且它应该为这些请求的 ID 单独返回文档文件。我已尝试通过以下链接接受的答案来实现此功能,但它不起作用。我不知道我哪里做错了。
从单个 WebApi 方法提供多个二进制文件的最佳方法是什么?
我的 Web Api 方法,
public async Task<HttpResponseMessage> DownloadMultiDocumentAsync(
IClaimedUser user, string documentId)
{
List<long> docIds = documentId.Split(',').Select(long.Parse).ToList();
List<Document> documentList = coreDataContext.Documents.Where(d => docIds.Contains(d.DocumentId) && d.IsActive).ToList();
var content = new MultipartContent();
CloudBlockBlob blob = null;
var container = GetBlobClient(tenantInfo);
var directory = container.GetDirectoryReference(
string.Format(DirectoryNameConfigValue, tenantInfo.TenantId.ToString(), documentList[0].ProjectId));
for (int docId = 0; docId < documentList.Count; docId++)
{
blob = directory.GetBlockBlobReference(DocumentNameConfigValue + documentList[docId].DocumentId);
if (!blob.Exists()) continue;
MemoryStream memStream = new MemoryStream();
await blob.DownloadToStreamAsync(memStream); …Run Code Online (Sandbox Code Playgroud) c# web-applications azure asp.net-web-api2 httpresponsemessage