This project has moved. For the latest updates, please go here.

NeatUpload 1.3.26 is not working on IIS7

Feb 17, 2011 at 12:47 PM
Edited Feb 17, 2011 at 12:49 PM

Hi Genius,

 

I am using VS2010 on windows 2007 64-bit machine to upload a 50MB word 2007 file and getting a NullReferenceException while running the application. I have referenced to "Brettle.Web.NeatUpload.dll" assembly in my application. I have tried with both type of application pool i.e. Default Application Pool and Classic .Net Pool but still getting the same error. My Code is as follows

Stack Trace

   at Brettle.Web.NeatUpload.UploadStorage.CreateUploadStorageConfig() in D:\__projects\Brettle\NeatUpload\dotnet\src\Brettle.Web.NeatUpload\Brettle.Web.NeatUpload\UploadStorage.cs:line 55
   at Brettle.Web.NeatUpload.FileControl.get_StorageConfig() in D:\__projects\Brettle\NeatUpload\dotnet\src\Brettle.Web.NeatUpload\Brettle.Web.NeatUpload\FileControl.cs:line 99
   at Brettle.Web.NeatUpload.InputFile.Render(HtmlTextWriter writer) in D:\__projects\Brettle\NeatUpload\dotnet\src\Brettle.Web.NeatUpload\Brettle.Web.NeatUpload\InputFile.cs:line 242
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
   at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
   at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
   at System.Web.UI.Page.Render(HtmlTextWriter writer)
   at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
   at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 ASPX Page
============
   <div>
        <Upload:InputFile id="inputFieldID" runat="server" />
        <Upload:ProgressBar id="progressBarId" runat="server" inline="false" />
        <asp:Button id="submitButtonId" runat="server" Text="Submit" />
    </div>


Code Behind
===================
      if (IsValid && inputFieldID.HasFile)
      {
                inputFieldID.MoveTo(Path.Combine(Request.PhysicalApplicationPath, inputFieldID.FileName), Brettle.Web.NeatUpload.MoveToOptions.Overwrite);
}
Configuration File
====================
<configuration>
<configSections>
<sectionGroup name="system.web">
<section name="neatUpload" type="Brettle.Web.NeatUpload.ConfigSectionHandler, Brettle.Web.NeatUpload" allowLocation="true"/>
</sectionGroup>
</configSections>
<system.web>
<neatUpload useHttpModule="true" maxNormalRequestLength="20480" maxRequestLength="11000" defaultProvider="FilesystemUploadStorageProvider"/>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" preCondition="managedHandler"/>
</modules>
</system.webServer>
</configuration>

Also I am looking for NeatUpload that is compatible with framework 1.1. Any link/code sample would helpful for me.

This is urgently required in one of the my application so any help would be heartily appreciated.

Looking for quick response on this :)
May 14, 2011 at 9:39 PM

shashikant_76,

I have run into the same exact error and solved the issue by explicitly defining the default storage provider (defaultStorageProvider) within the neatUpload configuration section as shown below:

 

<configuration>
<configSections>
<sectionGroup name="system.web">
<section name="neatUpload" type="Brettle.Web.NeatUpload.ConfigSectionHandler, Brettle.Web.NeatUpload" allowLocation="true"/>
</sectionGroup>
</configSections>
<system.web>
<neatUpload useHttpModule="true" maxNormalRequestLength="20480" maxRequestLength="11000" defaultProvider="FilesystemUploadStorageProvider"/>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" preCondition="managedHandler"/>
</modules>
</system.webServer>

   <neatUpload xmlns="http://www.brettle.com/neatupload/config/2008" 
	useHttpModule="true" 
	maxNormalRequestLength="51200" 
	maxRequestLength="51200" maxUploadRate="-1" 
	multiRequestUploadHandlerUrl="~/NeatUpload/MultiRequestUploadHandler.ashx" 
	debugDirectory="~/NeatUpload/debug/" 
	stateMergeIntervalSeconds="1" 
	stateStaleAfterSeconds="60" 
	defaultStorageProvider="FilesystemUploadStorageProvider" 
	defaultStateStoreProvider="AdaptiveUploadStateStoreProvider">
	   <providers>
		 <add name="FilesystemUploadStorageProvider" type="Brettle.Web.NeatUpload.FilesystemUploadStorageProvider" tempDirectory="~/App_Data/NeatUpload_Temp/"/>
	   </providers>
  </neatUpload> 

</configuration>

Hope that works for you too :-)

Brad