快崩溃了,Dsoframer保存到服务期的问题
我下的是2.2.1.2版的,看网上的资料应该是支持用Save("http://server/file")的格式来保存文件到服务器的。但是这几天怎么调都不成,我服务器用的是2003,请问是否还有什么权限需要设置?写入权限我已经加了。
------解决方案--------------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Net;
public partial class CheckSystem_CheckNotice_SaveFinish : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
BinaryReader bReader = new BinaryReader(Request.InputStream);
string strTemp = System.Text.Encoding.GetEncoding("iso-8859-1").GetString(
bReader.ReadBytes((int)bReader.BaseStream.Length), 0, (int)bReader.BaseStream.Length);
string match = "Content-Type: application/msword\r\n\r\n";
int pos = strTemp.IndexOf(match) + match.Length;
bReader.BaseStream.Seek(pos, SeekOrigin.Begin);
string newFileName = DateTime.Now.ToFileTime().ToString() + UsersInfo.GetUserRealName + ".doc";
string newFile = Server.MapPath("~/") + "CheckSystem\\CheckFinish\\" + newFileName;
// string newFile = Server.MapPath(".") + "\\"+ID+"1.doc";
FileStream newDoc = new FileStream(newFile, FileMode.Create, FileAccess.Write);
BinaryWriter bWriter = new BinaryWriter(newDoc);
bWriter.BaseStream.Seek(0, SeekOrigin.End);
while (bReader.BaseStream.Position < bReader.BaseStream.Length - 38)
bWriter.Write(bReader.ReadByte());
bReader.Close();
bWriter.Flush();
bWriter.Close();
}
}
我正在用的 测试无误