您好,您用的是 SaveExcel(stream ,这个重载方法是保存到内存中,如果您需要保存到服务器,将这个stream 再保存成文件就好了。
参考代码
- FileStream fileStream = File.Create(fileFullPath, (int)stream.Length);
- // Initialize the bytes array with the stream length and then fill it with data
- byte[] bytesInStream = new byte[stream.Length];
- stream.Read(bytesInStream, 0, bytesInStream.Length);
- // Use write method to write to the file specified above
- fileStream.Write(bytesInStream, 0, bytesInStream.Length);
复制代码 |