stream为服务端接收的文件流
var bytes = new byte[stream.Length];
stream.Read(bytes, 0, bytes.Length);
// 设置当前流的位置为流的开始
stream.Seek(0, SeekOrigin.Begin);


var pathHead = HttpContext.Current.Request.PhysicalApplicationPath;
if (!Directory.Exists(path))
   Directory.CreateDirectory(path);
var resultPath = path + "文件.后缀";
var fileStream = new FileStream(resultPath, FileMode.Create, FileAccess.ReadWrite);
//文件写入
fileStream.Write(bytes, 0, bytes.Length);
fileStream.Flush();
fileStream.Close();

  

相关文章:

  • 2022-02-08
  • 2021-08-10
  • 2021-05-20
  • 2022-12-23
  • 2021-09-17
  • 2021-09-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-30
  • 2022-12-23
  • 2021-06-17
  • 2021-07-20
  • 2021-07-23
相关资源
相似解决方案