关于FCKeditor中贴大量文本提交出错的问题

楼主发表于:2006-06-16 12:01:19
在asp中在FCKeditor中贴文本内容(单篇估计80K左右,html控件是不是每个控件最多只能是100K?),

如果只粘贴一次( <100K),那么可以成功提交。
如果粘贴2次(> 100K),那么提交就出错。(我用.net版试了下,又不会出错)。

已经排除了是一些非法字符的影响,而且也还没有写入到数据库。

以前做过通过在客户端把超过100k的HTML控件的内容拆分成很多个 <100K的隐藏控件发送到服务端就可以了。这里想问FCKeditor内部有没有提供这个支持?或者为什么.net的可以?asp的不可以?

这里想问2个问题
1、是不是IE中的单个HTML控件最多只能提交100K的数据?
2、上面的FCKeditor问题怎么解决?
 
 
回复次数: 22

 

  • yeetoo用户头像
  • yeetoo
  • (一土)
  • 等 级:
#1楼 得分:90回复于:2006-06-16 12:06:50
如果是windows   2003默认最大能提交200k的数据.你需要改一下配置文件,

找到windows/system32/inesrv/下的metabase.xml,

  用计事本打开metabase.xml,找到ASPMaxRequestEntityAllowed   把他修改为需要的值,默认为204800,即200K

重启IIS.
 
  • yeetoo用户头像
  • yeetoo
  • (一土)
  • 等 级:
#2楼 得分:0回复于:2006-06-16 12:09:16
另外在我的实践中我也发现了window2000下也会有此问题,这并非是FCKEditor的问题,而是微软的问题.可能ASP组件的Request对象的Form属性有问题.
 
#3楼 得分:10回复于:2006-06-16 12:14:05
form表单提交最大信息量不能超过100K

有办法解决
接收页面
tmp   =   " "
For   I   =   1   To   Request.Form( "BigTextArea ").Count  
      tmp=   tmp&   Request.Form( "BigTextArea ")(I)  
Next  
tmp就是结果了~~
 
#4楼 得分:0回复于:2006-06-16 12:19:17
我现在也是用2003的系统
MetaBase.xml文件不能修改?怎么一直提示正在被使用?
IIS我已经停了阿。
另外就是我现在主要使用.net开发,可是之前的系统有用asp的,在.net中贴大量文本就不会有问题,可是在asp中就会。。。贴同一份文本.net的没问题,asp的有问题。。
 
  • yeetoo用户头像
  • yeetoo
  • (一土)
  • 等 级:
#5楼 得分:0回复于:2006-06-16 12:22:31
IIS的相关服务要停了再修改那个文件.

另外jinfeng003(小高手)   的解答应该是正确的,   因为我从来没有试过那样的用法,原来form的对象也可以是一个集合.

你试试.
 
#6楼 得分:0回复于:2006-06-16 12:24:41
没问题的,放心用好了~~

我一直这么用,呵呵
 
#7楼 得分:0回复于:2006-06-16 12:33:09
form表单提交最大信息量不能超过100K

有办法解决
接收页面
tmp   =   " "
For   I   =   1   To   Request.Form( "BigTextArea ").Count  
      tmp=   tmp&   Request.Form( "BigTextArea ")(I)  
Next  
tmp就是结果了~~


这个是不是要在客户端Javascript拆分那个名为   BigTextArea   的HTML控件的内容?
 
#8楼 得分:0回复于:2006-06-16 12:42:09
不用拆分,什么也不用写。直接用就可以

BigTextArea是文本区的名称
表单提交以后,页面循环获取文本框内容
 
#9楼 得分:0回复于:2006-06-16 12:44:34
yeetoo(一土)的那个方法我刚刚试了,
确实可以的。
谢谢了。

jinfeng003(小高手)
的那个方法还没试,最好能提供点样例代码?

之后结帖。
 
#10楼 得分:0回复于:2006-06-16 12:45:29
try   下
 
  • yeetoo用户头像
  • yeetoo
  • (一土)
  • 等 级:
#11楼 得分:0回复于:2006-06-16 12:51:54
我试一下:

dim   str

if   isarray(   request.form( "item_1 ")   )   =   true   then   '如果过了100K,那么就会转为数组
        dim   nCount
        For   nCount   =   0   To   Request.Form( "item_1 ").Count   -   1
        str   =   str   &   Request.Form( "item_1 ")(nCount)
        Next          
else   '100K以内
        str   =   request.form( "item_1 ")
end   if

str就是最后的输入框的内容
 
  • yeetoo用户头像
  • yeetoo
  • (一土)
  • 等 级:
#12楼 得分:0回复于:2006-06-16 12:59:25
修改:

dim   str

if   isarray(   request.form( "item_1 ")   )   =   true   then   '如果过了100K,那么就会转为数组
dim   nCount
For   nCount   =   1   To   Request.Form( "item_1 ").Count
str   =   str   &   Request.Form( "item_1 ")(nCount)
Next
else   '100K以内
str   =   request.form( "item_1 ")
end   if

str就是最后的输入框item_1的内容

微软对request.form是这样解释的:
You   can   use   an   iterator   to   loop   through   all   the   data   values   in   a   form   request.   For   example,   if   a   user   filled   out   a   form   by   specifying   two   values,   Chocolate   and   Butterscotch,   for   the   FavoriteFlavor   parameter,   you   could   retrieve   those   values   by   using   the   following   script.
The   same   output   can   be   generated   with   a   For...Next   loop,   as   shown   in   the   following   script.  

<%
For   i   =   1   To   Request.Form( "FavoriteFlavor ").Count
    Response.Write   Request.Form( "FavoriteFlavor ")(i)   &   " <BR> "
Next
%>

 
#13楼 得分:0回复于:2006-06-16 13:06:13
我把ASPMaxRequestEntityAllowed   改到原来的数值了,
用jinfeng003(小高手)   的方法好像还是不行。。。非数组的时候可以正确执行,
如果数据多了,之后就直接在   if   isarray(Request.Form( "FCKeditor1 "))   then   这一行提示错误
Request   对象   错误   'ASP   0104   :   80004005 '  

不允许操作  

/FCKeditor/_samples/asp/sampleposteddata.asp,行   3  

<%
Dim   intNeko,content
if   isarray(Request.Form( "FCKeditor1 "))   then
Response.Write( "数组 <br> ")
for   intNeko   =   0   to   Request.Form( "FCKeditor1 ").Count
Response.write(len(Request.Form( "FCKeditor1 ")(intNeko))   &   ": "   &   intNeko   &   " <br> ")
content   =   content   &   Request.Form( "FCKeditor1 ")(intNeko)
next
Response.Write(content)
Response.End()
else
Response.Write( "非数组。 <br> ")
Response.Write(Request.form( "FCKeditor1 "))
end   if
%>
 
#14楼 得分:0回复于:2006-06-16 13:07:53
那个英文的意思好像是说一个页面中有2个控件使用同样的name,
比如地址
<intput   name= "Address "   ……
<intput   name= "Address "   ……
之后request.form( "Address ")就是一个数组对象
 
  • yeetoo用户头像
  • yeetoo
  • (一土)
  • 等 级:
#15楼 得分:0回复于:2006-06-16 13:13:28
楼上的理解没错.

我们要试的是如果一个input超出100k,也会不会自动转为容器传上来.
 
#16楼 得分:0回复于:2006-06-16 13:19:36

按照我目前对表单的理解是那些数据都可以post到服务器,只是服务器有没有接受的问题,而这个属性   ASPMaxRequestEntityAllowed     就是设置最大的表单总数据量(还是一个HTML控件的数据量?Entity   实体?),如果太大了,那么IIS分配给这个请求的数据将没地方存放?所以导致错误?
如果jinfeng003(小高手)   说的方法可行,那么ASPMaxRequestEntityAllowed的意思应该是单个HTML的最大上传数据量,之后IE在提交给服务器之前自动拆分成多个控件?并且以相同的name发送到服务端??
不过我刚才试是不可以的。。
 
#17楼 得分:0回复于:2006-06-16 13:21:01
The   AspMaxRequestEntityAllowed   property   specifies   the   maximum   number   of   bytes   allowed   in   the   entity   body   of   an   ASP   request.   If   a   Content-Length   header   is   present   and   specifies   an   amount   of   data   greater   than   the   value   of   AspMaxRequestEntityAllowed,   IIS   returns   a   403   error   response.   This   property   is   related   in   function   to   MaxRequestEntityAllowed,   but   is   specific   to   ASP   request.   Whereas   you   might   set   the   MaxRequestEntityAllowed   property   to   1   MB   at   the   general   World   Wide   Web   Publishing   Service   (WWW   Service)   level,   you   may   choose   to   set   AspMaxRequestEntityAllowed   to   a   lower   value,   if   you   know   that   your   specific   ASP   applications   handle   a   smaller   amount   of   data.

 
#18楼 得分:0回复于:2006-06-16 13:23:54
AspMaxRequestEntityAllowed   表示的是整个表单的总数据量。。
好的,结贴了,谢谢2位了。
不过jinfeng003(小高手)   的那个方法一直没有试出来,有点遗憾。。
 
  • yeetoo用户头像
  • yeetoo
  • (一土)
  • 等 级:
#19楼 得分:0回复于:2006-06-16 13:29:57
这是我的最终实验结果:   (结果是不行!!!)

错误如下:
Request   object   error   'ASP   0107   :   80004005 '  

Stack   Overflow  

/textarea2.asp,   line   5  

The   data   being   processed   is   over   the   allowed   limit.  

证明我以前的观点是对的.
 
  • yeetoo用户头像
  • yeetoo
  • (一土)
  • 等 级:
#20楼 得分:0回复于:2006-06-16 13:40:49
数据确实post到服务器上了.

但是由于ASP组件的限制,毕竟它是用参数来传递数据的,超出1024*100字节就会出现堆栈溢出的异常.估计是

是它内部用了_com_util::ConvertStringToBSTR()函数导致的(只是一个猜测,呵呵)

所以可以说一个ASP组件最大能处理一个input的传上来的字符串长度为100k,说明ASP.dll组件开发的不是很完美的.
 
#21楼 得分:0回复于:2006-06-16 14:59:43
和你有一样的错误!!

解决的办法是jinfeng003(小高手)的那种,也可以告诉客户,让他把大的文件分成2个再添加
 
  •  
  • yeetoo
  • (一土)
  • 等 级:
#22楼 得分:0回复于:2006-06-16 15:44:09
dim   a  
for   a   =   1   to   Request.Form.Item( "content ").count
Response.Write   Request.Form.Item( "content ")(a)
next

这样确实是正确的.

是我测试的时候没有认真去测试
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值