httpruntime

Uploading file size over 4 MB in .NET

℡╲_俬逩灬. 提交于 2019-12-24 03:04:36
问题 I am having trouble uploading a file size over 4 MB. I've tried adding <httpRuntime maxRequestLength="102400" executionTimeout="99999" /> to my Web.Config like many posts have suggested, but it just isn't working. Files under 4 MB work just fine, so I'm nearly certain I'm running into the 4 MB limit. Are there any settings in IIS that I might need to change? 回答1: You need to update the value of maxrequestlength in the web.config: Maximum value of maxRequestLength? Max Request Length 回答2: You

Locking HttpRuntime.Cache for lazy loading

∥☆過路亽.° 提交于 2019-12-22 10:07:00
问题 We have a website running .NET 2.0 and have started using the ASP.Net HttpRuntime.Cache to store the results of frequent data lookups to cut down our database access. Snippet: lock (locker) { if (HttpRuntime.Cache[cacheKey] == null) { HttpRuntime.Cache.Insert(cacheKey, GetSomeDataToCache(), null, DateTime.Today.AddDays(1), Cache.NoSlidingExpiration); } return ((SomeData)HttpRuntime.Cache[cacheKey]).Copy(); } We are pessimistically locking whenever we want to look at the cache. However, I've

HttpRuntime Cache vs. static dictionary/fields

僤鯓⒐⒋嵵緔 提交于 2019-12-13 11:41:52
问题 What are the main pros and cons for using HttpRuntime Cache against using simple static field? I need to store data in scope of entire ASP.NET application. HttpRuntime.Cache["MyData"] = someHashtable; vs. private static System.Collections.Hashtable _myData; public static System.Collections.Hashtable MyData { get { if (_myData == null) { _myData = new System.Collections.Hashtable(); // TODO: Load data } return _myData; } } 回答1: Objects in HttpRuntime.Cache have unknown expiry periods unless

getting a connection was reset error on asp.net

假如想象 提交于 2019-12-12 05:13:40
问题 I'm am try trying to upload Video and audio file on live website. the example: domain.com/admin/fileupload.aspx that was a url. I use this code in web.config this : <httpRuntime executionTimeout="1000" maxRequestLength="1048576" /> with this web.config setting i didn't get The error connection was reset error on run time that is working on localhost:port/domainfolder/admin/fileupload.aspx very well. but that is not working on live domain. i also try this in live web.confg setting that is

Upload large files on webpage?

*爱你&永不变心* 提交于 2019-12-11 07:42:26
问题 We use the MojoPortal to a website and have some problems to upload files that is around 100 MB with the upload module. (Pleas note that this has probably nothing to do with MojoPortal but with the ASP.NET and the IIS) The MojoPortal is set to use regular file Upload(not Neat Uploader) and to be able to upload big files we have set the following : <httpRuntime maxRequestLength="2097151" executionTimeout="18000" requestValidationMode="2.0"/> And : <compilation debug="false" defaultLanguage="C#

ASP.NET the targetframework attribute is not allowed

我的未来我决定 提交于 2019-12-11 02:08:07
问题 I have these lines in my web.config: <httpRuntime maxRequestLength="5120000" executionTimeout="54000" requestValidationMode="2.0" targetFramework="4.5"/> <compilation debug="true" strict="false" explicit="true" targetFramework="4.5"> But on the httpRuntime element I get the design time error the targetframework attribute is not allowed The strange thing is that this occurs on my local development machine and other sites on it work fine with these definitions in their respective web.config

Ajax AsyncFileUpload.FileBytes returns null

泪湿孤枕 提交于 2019-12-08 13:33:00
问题 I have a file upload page with an AsyncFileUpload control. When the user browses to the file the upload control pulls the file into memory. I then have an Upload button which fires the following code to save the file to a database. I am finding that if files are over about 500KB then the FileBytes property of the control simply returns null. This happens on my server but when running the app locally it runs through fine. I'm not handling the OnUploadCompleted event as I need to user to

Locking HttpRuntime.Cache for lazy loading

寵の児 提交于 2019-12-05 20:04:25
We have a website running .NET 2.0 and have started using the ASP.Net HttpRuntime.Cache to store the results of frequent data lookups to cut down our database access. Snippet: lock (locker) { if (HttpRuntime.Cache[cacheKey] == null) { HttpRuntime.Cache.Insert(cacheKey, GetSomeDataToCache(), null, DateTime.Today.AddDays(1), Cache.NoSlidingExpiration); } return ((SomeData)HttpRuntime.Cache[cacheKey]).Copy(); } We are pessimistically locking whenever we want to look at the cache. However, I've seen various blogs posted around the web suggesting you lock after you check the cache value instead, to

ASP.Net httpruntime executionTimeout not working (and yes debug=false)

陌路散爱 提交于 2019-11-28 08:16:41
We just recently noticed that executionTimeout has stopped working on our website. It was definitely working ~last year ... hard to say when it stopped. We are currently running on: Windows-2008x64 IIS7 32bit binaries Managed Pipeline Mode = classic Framework version = v2.0 Web.Config has <compilation defaultLanguage="vb" debug="false" batch="true"> <httpRuntime executionTimeout="90" /> Any hints on why we are seeing Timetaken all the way up to ~20 minutes. Would compilation options for DebugType (full vs pdbonly) have any effect? datetime timetaken httpmethod Status Sent Received<BR> 12/19/10