public IActionResult Attachment(int docId, Guid attId)
        {
            DocumentStorage attachments = _storage[docId];

            FileItem attachment = attachments.GetFile(attId);

            if (attachment == null)
            {
                return(NotFound());
            }

            _logger.LogInformation($"Запрос на предоставление вложения для документа [ID={docId}]: {attachment.FileName}");

            return(File(attachment.Stream, attachment.MimeType, attachment.FileName));
        }
Example #2
0
        public IActionResult Attachment(int docId, Guid attId)
        {
            DocumentStorage attachments = _storage[docId];

            FileItem attachment = attachments.GetFile(attId);

            if (attachment == null)
            {
                return(NotFound());
            }

            _logger.LogInformation($"Yêu cầu tài liệu đính kèm [ID={docId}]: {attachment.FileName}");

            return(File(attachment.Stream, attachment.MimeType, attachment.FileName));
        }