| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.Dynamic; |
| | | using System.IO; |
| | | using System.Net.Http.Headers; |
| | | |
| | | namespace MESApplication.Controllers.PLM; |
| | | |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | //MP-O型圈-83070100066样品1-83070100068样品2.pdf |
| | | //e18f53b6-6615-8140-11ee-423d1dd32487 |
| | | //RetrieveDrawings 调取图纸 get方式 |
| | | [HttpGet("OpenDrawingsGet")] |
| | | public IActionResult OpenDrawingsGet(string fileId, string fName) |
| | | { |
| | | try |
| | | { |
| | | var resultInfos = wdd.SendRequest("Download", fileId); |
| | | |
| | | // 添加Content-Disposition响应头 |
| | | var cd = new ContentDispositionHeaderValue("attachment"); |
| | | cd.FileNameStar = fName; // 自动处理编码 |
| | | Response.Headers.Add("Content-Disposition", cd.ToString()); |
| | | |
| | | return File(resultInfos, "application/octet-stream", fName); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return StatusCode(500, new ResponseResult |
| | | { |
| | | status = 1, |
| | | message = ex.Message, |
| | | data = null |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |