Wely

wel = new Geeks();
See also: Other Geeks@INDC

ASP.NET 2.0 FileUpload Problems

I was wondering why I got error when I upload big size file (4 or 5 MB). But when 3.9 MB, it worked well. My colleague told that we have to change a key "AspMaxRequestEntityAllowed" at MetaBase.xml which is located in C:\WINDOWS\system32\inetsrv. I tried it but still could not fix my problem.

 

At last, I found an article in the internet http://community.sgdotnet.org/blogs/chuawenching/archive/2006/04/25/25995.aspx

 

Yeah... By default we are not allowed to upload < 4 MB from FileUpload. To overcome this problem, we have to add a key in our configuration file (web.config).

<httpRuntime
executionTimeout = "110" [in Seconds][number
maxRequestLength = "4096" [number]
requestLengthDiskThreshold = "80" [number]
useFullyQualifiedRedirectUrl = "false" [true|false]
minFreeThreads = "8" [number]
minLocalRequestFreeThreads = "4" [number]
appRequestQueueLimit = "5000" [number]
enableKernelOutputCache = "true" [true|false]
enableVersionHeader = "true" [true|false]
apartmentThreading = "false" [true|false]
requireRootedSaveAsPath = "true" [true|false]
enable = "true" [true|false]
sendCacheControlHeader = "true" [true|false]
shutdownTimeout = "90" [in Seconds][number]
delayNotificationTimeout = "5" [in Seconds][number]
waitChangeNotification = "0" [number]
maxWaitChangeNotification = "0" [number]
enableHeaderChecking = "true" [true|false]
/>

See maxRequestLength -> it is in KB. So if I am going to upload below 10 MB, fill it with 10240. And also, take a look at executionTimeout which is the the time out for uploading the file. It is in seconds.

Share this post: | | | |
Posted: Sep 27 2007, 01:44 PM by Wely | with 1 comment(s)
Filed under: ,

Comments

Agus Kurniawan said:

gw udah mengabadikan dalam bentuk video tutorial tentang ini bisa dilihat di PE College:

http://www.pecollege.net/VideoTutorialDotnet/tabid/68/Default.aspx

Belajar Pemrograman Upload File dengan ASP.NET 2.0 (Kode: PE108)

# October 1, 2007 7:47 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 
Are you human?:  


Enter the numbers above: