文件上传的Web控件不能处理大量的JPG文件(5MB)? [英] FileUpload web control can't handle large jpg files(5MB)?

查看:183
本文介绍了文件上传的Web控件不能处理大量的JPG文件(5MB)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我测试的Visual Studio自己的ASP.NET开发服务器(本地服务器)上的一个非常简单的aspx页面。网页上有哪些可以上传JPG文件高达2MB没有问题的FileUpload控件。在上传更大的文件,浏览器immidiately显示该网页无法显示。它不显示这着实让我为难任何异常。 无法显示的网页通常是由网络问题引起的,但在这种情况下,它是一个本地服务器,并能够处理较小的jpg文件细。 Whta这里的问题?

I'm testing a very simple aspx page on Visual Studio's own ASP.NET Development Server(the local server). On the webpage there is a FileUpload control which can upload jpg file up to 2MB without problems. On uploading bigger files, the browser immidiately show "The web page cannot be displayed". It does not show any exception which really puzzles me. "The web page cannot be displayed" is normally caused by network problem, but in this case it's a local server and it can handle smaller jpg file fine. Whta's the problem here?

推荐答案

的最大上传大小为4MB默认。你可以改变它在web.config中

The max upload size is 4MB by default. You can change it on web.config

<system.web>
    <httpRuntime maxRequestLength="size" executionTimeout="seconds"/>
</system.web>

要考虑到上传大文件没有任何反馈给用户可能不是很人性化。你应该仔细分析如何实现的接口。

Take into account that uploading large files without any feedback to the user could be not very user-friendly. You should analyze carefully how to implement the interface.

在这里,你有一个的httpRuntime元素的完整参考

Here you have the complete reference for httpRuntime Element

http://msdn.microsoft.com/ EN-US /库/ e1f13641%28VS.71%29.aspx

这篇关于文件上传的Web控件不能处理大量的JPG文件(5MB)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆