日期:2014-05-17  浏览次数:20544 次

关于上传的问题
我的上传方式是:form post 传到.aspx页面

现在已经实现,文件也可以上传(小文件)。

但是有个问题:文件小的可以上传,图片大的就不能上传了,而且根本就传不到后台去,在前台就出错了,这是怎么回事?。



这是谷歌的错误信息:

POST http://localhost:5055/%E5%9C%A8%E7%BA%BFppt%E7%BC%96%E8%BE%91%E5%99%A8/allAshx/upload.aspx?title=%u662F%u7684%u65B9%u5F0F%u5730%u65B9&slidePage=1&div=img_0 :5055/%E5%9C%A8%E7%BA%BFppt%E7%BC%96%E8%BE%91%E5%99%A8/allAshx/upload.aspx?title=%u662F%u7684%u65B9%u5F0F%u5730%u65B9&slidePage=1&div=img_0:1


Request URL:http://localhost:5055/%E5%9C%A8%E7%BA%BFppt%E7%BC%96%E8%BE%91%E5%99%A8/allAshx/upload.aspx?title=%u662F%u7684%u65B9%u5F0F%u5730%u65B9&slidePage=1&div=img_0
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryMjnIefP405UHK2j8
Origin:http://localhost:5055
Referer:http://localhost:5055/%E5%9C%A8%E7%BA%BFppt%E7%BC%96%E8%BE%91%E5%99%A8/index.html?title=%u662F%u7684%u65B9%u5F0F%u5730%u65B9
User-Agent:Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.10 (KHTML, like Gecko) Chrome/23.0.1262.0 Safari/537.10
Query String Parametersview URL encoded
title:(unable to decode value)
slidePage:1
div:img_0
Request Payload
------WebKitFormBoundaryMjnIefP405UHK2j8
Content-Disposition: form-data; name="imgname"; filename="jinhuayuan.zip"
Content-Type: application/octet-stream


------WebKitFormBoundaryMjnIefP405UHK2j8
Content-Disposition: form-data; name="columns"

0
------WebKitFormBoundaryMjnIefP405UHK2j8
Content-Disposition: form-data; name="rows"

0
------WebKitFormBoundaryMjnIefP405UHK2j8--




------解决方案--------------------
C# code
 1 <system.web>
 2 <httpRuntime
 3 maxRequestLength="40690"
 4      useFullyQualifiedRedirectUrl="true"
 5      executionTimeout="6000"
 6      useFullyQualifiedRedirectUrl="false" 
 7      minFreeThreads="8" 
 8      minLocalRequestFreeThreads="4" 
 9      appRequestQueueLimit="100" 
10      enableVersionHeader="true"
11 />
12 </system.web>

------解决方案--------------------
楼上说的是对的