rt
解决方案 »
- asp.net 数组问题
- 在gridview里加了下拉框,怎么样传下拉框的值到objectdatasource
- ASP.NET新手求教!!!只有20分,都给了!
- 程序中共有几种流程序啊?比如:文件流,媒体流,内存流等...
- 看看你对oo了解多少?
- 郁闷,两个Dropdownlist老出现同步选中的问题
- detailsview怎么加onmouseover事件
- 求写计数器。。。。
- 关于制作activeX的问题
- 各位老师,小弟遇到的一个问题,真是难啊
- <%# Repeater_SwitchPics.Items.Count % 2 == 1 ? "<td></td></tr> " : ""%>
- fckeditor控件 字数限制
<httpRuntime
executionTimeout="300"
maxRequestLength="40960"
useFullyQualifiedRedirectUrl="false"/> 如果还不行,可以使用思归提供的方案:
我们在上传大文件时都遇到过这样或那样的问题。设置很大的maxRequestLength值并不能完全解决问题,因为ASP.NET会block直到把整个文件载入内存后,再加以处理。实际上,如果文件很大的话,我们经常会见到Internet Explorer显示 "The page cannot be displayed - Cannot find server or DNS Error",好像是怎么也catch不了这个错误。为什么?因为这是个client side错误,server side端的Application_Error是处理不到的,可以参考这个帖子研究一下产生这个错误的机理。
handling server error when upload file too large
解决的方法是利用隐含的HttpWorkerRequest,用它的GetPreloadedEntityBody 和 ReadEntityBody方法从IIS为ASP.NET建立的pipe里分块读取数据
IServiceProvider provider = (IServiceProvider) HttpContext.Current;
HttpWorkerRequest wr = (HttpWorkerRequest) provider.GetService(typeof(HttpWorkerRequest));
byte[] bs = wr.GetPreloadedEntityBody();
....
if (!wr.IsEntireEntityBodyIsPreloaded())
{
int n = 1024;
byte[] bs2 = new byte[n];
while (wr.ReadEntityBody(bs2,n) >0)
{
.....
}
}
FileUpload1.PostedFile.ContentLength
文件大小只能去服务器上判断,扩展名可以用客户端的
大文件断点续传