public void UploadTest() { var path = "C:\\Users\\wl004\\OneDrive\\桌面\\WorkTool_Core_MVC\\WorkTool\\WorkToolNTest\\TestDocument\\Test.txt"; var file = new FileStream(path, FileMode.Open); var ms = new MemoryStream(); file.CopyTo(ms); IFormFile formFile = new FormFile( baseStream: ms, baseStreamOffset: 0, length: file.Length, name: "data", fileName: "Test.txt" ); _untity.Upload(formFile); Assert.Pass(); }
public void Upload(IFormFile file) => _unity.Upload(file);