| | |
| | | using Newtonsoft.Json; |
| | | using Tiger.IBusiness; |
| | | using Tiger.Api.iBiz; |
| | | using System.IO; |
| | | |
| | | namespace Tiger.Api.Controllers.Base |
| | | { |
| | |
| | | return Ok(response); |
| | | } |
| | | #endregion |
| | | |
| | | #region 文件上传 |
| | | /// <summary> |
| | | /// 文件上传 |
| | | /// </summary> |
| | | /// <param name="file"></param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public async Task<IActionResult> Upload(IFormFile file) |
| | | { |
| | | if (file == null || file.Length == 0) |
| | | return BadRequest("No file uploaded."); |
| | | |
| | | var path = Path.Combine(@"D:\nginx-1.26.0\html", "upload", file.FileName); |
| | | |
| | | using (var stream = new FileStream(path, FileMode.Create)) |
| | | { |
| | | await file.CopyToAsync(stream); |
| | | } |
| | | |
| | | return Ok(new { file.FileName, file.ContentType, file.Length, url= $@"{BizConfig.Configuration["DownloadAddress"]}/"+ file.FileName }); |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | "CurrentProject": "MqBarcode", |
| | | "JuDian": "XCSJ", |
| | | "IsTestServer": false, |
| | | "IsUseDbCache": false |
| | | "IsUseDbCache": false, |
| | | "DownloadAddress": "http://47.115.28.255:8800/files" |
| | | } |