dsoframer.ocx 保存问题,超过5M的内容就保存不了???急急急
我用的是dsoframer.ocx 在线打开doc和保存5M以下的doc都没问题,一但内容多了,文件内容大于5M后怎么保存不了,而且很慢,不知道用什么方法可以解决,谢谢各位大哥。editdoc.aspx代码如下:
function SaveToWeb(){
document.all.FramerControl1.HttpInit();
document.all.FramerControl1.HttpAddPostString("RecordID","20060102200");
document.all.FramerControl1.HttpAddPostString("UserID","aaa");
document.all.FramerControl1.HttpAddPostCurrFile("FileData", "<%=FileName %>");
document.all.FramerControl1.HttpPost("http://"+window.location.host+"/Read_doc/SaveDoc.aspx?FilePath=<%=FileName %>");
alert("对文件的修改已经保存成功!");
window.location.href ="http://127.0.0.1/sys/read.aspx" ;
}
savedoc.aspx代码如下:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Net;
public partial class DsoFramer_SaveDoc : System.Web.UI.Page
{
readonly int enterCount = 12;
string[] requestValues = new string[3];
protected void Page_Load(object sender, EventArgs e)
{
string newFile = Server.MapPath(".") + "\\" + Request.QueryString["FilePath"] + "";
FileStream newDoc = new FileStream(newFile, FileMode.Create, FileAccess.Write);
BinaryReader br = new BinaryReader(Request.InputStream);
BinaryWriter bw = new BinaryWriter(newDoc);
br.BaseStream.Seek(0, SeekOrigin.Begin);
bw.BaseStream.Seek(0, SeekOrigin.End);
int enterNo = 0;
int streamHeadLen = 0;
while (br.BaseStream.Position < br.BaseStream.Length)
{
streamHeadLen++;
char c = (char)br.ReadByte();
if (enterNo < enterCount)
{
if (c == '\n')
{
enterNo++;
}
}
else
{
break;
}
}
br.BaseStream.Seek(0, SeekOrigin.Begin);
string strTemp = System.Text.UTF32Encoding.Default.GetString(br.ReadBytes(streamHeadLen - 1));
while (br.BaseStream.Position < br.BaseStream.Length - 38)
{
bw.Write(br.ReadByte());
}
br.Close();
bw.Flush();
bw.Close();
string[] requestStrings = { "RecordID", "UserID" };
for (int i = 0; i < requestStrings.Length; i++)
{
string str = "Content-Disposition: form-data; name=\"" + requestStrings[i] + "\"\r\n\r\n";
int index = strTemp.IndexOf(str) + str.Length;
if (index != str.Length - 1)
{
for (int j = index; j < strTemp.Length; j++)
{
if (strTemp[j] != '\r')
this.requestValues[i] += strTemp[j];
else
break;
}
}
}
} --------------------编程问答-------------------- 在 IIS 6.0 中,无法下载超过4M的附件时,可以按以下步骤解决:
1、先在服务里关闭 iis admin service 服务。
2、找到 windows\system32\inetsrv\ 下的 metabase.xml 文件。
3、用纯文本方式打开,找到 AspBufferingLimit 把它修改为需要的值(可修改为20M即:20480000)。
4、存盘,然后重启 iis admin service 服务。
补充:.NET技术 , ASP.NET