Ejemplo n.º 1
0
        /// <summary>根据FileID获得相关文件流, wang加</summary>
        public async Task <DownloadResult> DownloadAsync(string id)
        {
            var result = new DownloadResult();
            var file   = await _fileMan.GetByIdAsync(id);

            if (file == null)
            {
                throw new Exception("指定文件不存在");
            }
            return(Download(file));
        }
Ejemplo n.º 2
0
        /// <summary>根据FileID获得相关文件流, wang加</summary>
        public async Task <DownloadResult> DownloadAsync(string id)
        {
            var             result  = new DownloadResult();
            DownloadRequest request = new DownloadRequest();
            var             file    = await _fileMan.GetByIdAsync(id);

            if (file == null)
            {
                throw new Exception("指定文件不存在");
            }
            request.FileName   = file.Name;
            request.ContentRef = file.RelativePath;
            return(DownloadAsync(request, file));
        }