public async Task <IActionResult> DownloadFile(string fileId) { var memory = new MemoryStream(); var result = await _mongoRepository.DownloadFileAsync(fileId); memory = result.Item2; memory.Position = 0; return(File(memory, result.Item1.GetContentType(), Path.GetFileName(result.Item1))); }
public async Task <GridFSFileInfo> DownloadFileAsync(ObjectId id, GridFSDownloadOptions options = null) { return(await _repository.DownloadFileAsync(id, options)); }