1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-11 16:18:14 -05:00

set filename with ContentDisposition

This commit is contained in:
Kyle Spearrin 2018-11-06 21:43:34 -05:00
parent f60d6d92f8
commit dc3e083bf0

View File

@ -34,7 +34,7 @@ namespace Bit.Core.Services
{
blob.Metadata.Add("organizationId", cipher.OrganizationId.Value.ToString());
}
blob.Properties.ContentDisposition = "attachment";
blob.Properties.ContentDisposition = $"attachment; filename=\"{attachmentId}\"";
await blob.UploadFromStreamAsync(stream);
}
@ -44,7 +44,8 @@ namespace Bit.Core.Services
var blob = _attachmentsContainer.GetBlockBlobReference($"temp/{cipherId}/{organizationId}/{attachmentId}");
blob.Metadata.Add("cipherId", cipherId.ToString());
blob.Metadata.Add("organizationId", organizationId.ToString());
blob.Properties.ContentDisposition = "attachment";
blob.Properties.ContentDisposition = $"attachment; filename=\"{attachmentId}\"";
await blob.SetPropertiesAsync();
await blob.UploadFromStreamAsync(stream);
}