Ejemplo n.º 1
0
        public async Task <IActionResult> DownloadFile(int uploadId)
        {
            var fur  = _uploadService.GetUploadByUploadID(uploadId);
            var path = fur.PermanentFilePath + "\\" + fur.SysFileName;

            var memory = new MemoryStream();

            using (var stream = new FileStream(path, FileMode.Open))
            {
                await stream.CopyToAsync(memory);
            }
            memory.Position = 0;
            return(File(memory, GetContentType(path), Path.GetFileName(path)));
        }