File Upload - Nonfile portion > 4194304 bytes

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
6/22/2009 6:44:54 AM
Gravatar
Total Posts 245
mojoPortal Community Expert

File Upload - Nonfile portion > 4194304 bytes

Hi

I'm using a Telerik file upload control.  It is working good uploading pdf files under 4 Meg.
When they are larger than 4 Meg I get an error.

WebUtils.cs line 231 hostname = HttpContext.Current.Request.ServerVariables["SERVER_NAME"];

Then the error: Nonfile portion > 4194304 bytes

Exception Details: Brettle.Web.NeatUpload.NonfilePortionTooLargeException: Nonfile portion > 4194304 bytes.

[NonfilePortionTooLargeException: Nonfile portion > 4194304 bytes]
Brettle.Web.NeatUpload.Internal.Module.FilteringWorkerRequest.WriteParsedToOutputStream() +836
Brettle.Web.NeatUpload.Internal.Module.FilteringWorkerRequest.CopyUntilBoundary() +177
Brettle.Web.NeatUpload.Internal.Module.FilteringWorkerRequest.ParseOrThrow() +6850
Brettle.Web.NeatUpload.Internal.Module.FilteringWorkerRequest.ParseMultipart() +1738
Brettle.Web.NeatUpload.Internal.Module.FilteringWorkerRequest.GetKnownRequestHeader(Int32 index) +90
System.Web.HttpRequest.CombineAllHeaders(Boolean asRaw) +100
System.Web.HttpRequest.FillInServerVariablesCollection() +34
System.Web.HttpServerVarsCollection.Populate() +34
System.Web.HttpServerVarsCollection.Get(String name) +8634327
System.Collections.Specialized.NameValueCollection.get_Item(String name) +7
mojoPortal.Web.Framework.WebUtils.GetHostName() in C:\projects\mojoportal_bizzdok\mojoPortal.Web.Framework\WebUtils.cs:231
mojoPortal.Business.WebHelpers.CacheHelper.GetSiteSettingsFromCache() in C:\projects\mojoportal_bizzdok\mojoPortal.Business.WebHelpers\CacheHelper.cs:121
mojoPortal.Business.WebHelpers.CacheHelper.GetSiteSettingsFromContext() in C:\projects\mojoportal_bizzdok\mojoPortal.Business.WebHelpers\CacheHelper.cs:99
mojoPortal.Business.WebHelpers.CacheHelper.GetCurrentSiteSettings() in C:\projects\mojoportal_bizzdok\mojoPortal.Business.WebHelpers\CacheHelper.cs:89
mojoPortal.Web.UrlRewriter.GetRedirectUrl(String targetUrl) in C:\projects\mojoportal_bizzdok\Web\Components\UrlRewriter.cs:312
mojoPortal.Web.UrlRewriter.RewriteUrl(HttpApplication app) in C:\projects\mojoportal_bizzdok\Web\Components\UrlRewriter.cs:163
mojoPortal.Web.UrlRewriter.UrlRewriter_BeginRequest(Object sender, EventArgs e) in C:\projects\mojoportal_bizzdok\Web\Components\UrlRewriter.cs:68
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
 

I'm not using Brettle.Web.NeatUpload.

Maybe I should?????
 

6/22/2009 6:58:35 AM
Gravatar
Total Posts 18439

Re: File Upload - Nonfile portion > 4194304 bytes

Hi Rick,

I can't imagine the telerik control being as good an upload module as NeatUpload. With normal file uploads the entire file must be in server memory during the upload and with NeatUpload it can stream directly to disk. NeatUpload is an HttpModule that is involved with all requests even if you use some other upload control.

The max file size allowed to upload is determined by Web.config settings subject to enforcement also at the machine.config level.

In the case where NeatUpload is disabled like for Medium Trust by commenting it out in Web.config then the max file upload would be determined by a setting you can put in <system.web> section, by default 4MB is the limit unless you specify it.

<!--
this sets the max size of an upload if the
UploadHttpModule is not being used (ie commented out because it can't work in mediumtrust). In that case, the
entire request is stored in memory so large uploads
could be used as a Denial of Service attack.
use you own judgement in determining the max size of
a request you want to allow.
<httpRuntime maxRequestLength="2097151" executionTimeout="360" useFullyQualifiedRedirectUrl="true" />
-->

When NeatUpload is enabled, then it is determined by the NeatUpload section:

<neatUpload xmlns="http://www.brettle.com/neatupload/config/2008"
useHttpModule="true"
maxNormalRequestLength="4096"
maxRequestLength="2097151"
multiRequestUploadHandlerUrl="~/NeatUpload/MultiRequestUploadHandler.ashx"
maxUploadRate="300"
>
</neatUpload>

I believe that 2097151 is the max possible.

Hope it helps,

Joe

 

6/22/2009 2:42:21 PM
Gravatar
Total Posts 245
mojoPortal Community Expert

Re: File Upload - Nonfile portion > 4194304 bytes

Thanks for the response, info and advice Joe.

I'm switching to Brettle NeatUpload.

Rick Hubka

6/22/2009 2:43:31 PM
Gravatar
Total Posts 18439

Re: File Upload - Nonfile portion > 4194304 bytes

Thanks for the beers Rick!

Cheers,

Joe 

You must sign in to post in the forums. This thread is closed to new posts.