Search This Blog

Thursday, October 08, 2009

Using NeatUpload – simple setup (with GAC)

NeatUpload Manual available here.

I using this to document what I did to get NeatUpload running in my environment. Mainly to ensure that I have a record the next time I want to use this great open source product. A lot of this is in the netupload manual, but I don’t all of it was, either way I am just documenting for future reference and it it helps anyone else out so much the better.

edit:- I made the assumption that when I was adding this to the GAC I would not have to reference the dll within my asp.net in VS. However this was a misunderstanding on my part, and even though the dll is in the GAC you will still have to add a reference in your VS application.

First thing download and extract the latest version.

http://www.brettle.com/neatupload

Extract the archive.

Install the …\NeatUpload-1.3.18\dotnet\app\bin\Brettle.Web.NeatUpload.dll into the GAC (Global Assembly Cache). To view the GAC use windows explorer and type %WINDIR%/assembly.  You cannot just copy dlls into this folder….To install the dll use the GAC installation utility GACUtil.exe, I found this here C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\x64, however it can be in other locations. use search to find.

GACUtil –i “dlllocation\dll”

Once the dll is installed in the GAC (and this will need to be done wherever you want to use the upload , i.e webserver etc…). View the GAC (as described above) and make note of the version number.

image

You will use this information to change all the references in the aspx pages to define full string names. i.e.

type="Brettle.Web.NeatUpload.UploadHttpModule,Brettle.Web.NeatUpload"


will now become



type="Brettle.Web.NeatUpload.UploadHttpModule,Brettle.Web.NeatUpload,Version=1.3.3519.18793,Culture=neutral,PublicKeyToken=C95290D92C5893C8"


Now copy the folder ..\NeatUpload-1.3.18\dotnet\app\NeatUpload into the root of your application.



Now change all references in all apsx, ashx pages within the neatupload folder to full strong name references… i.e. in progress.aspx



Inherits="Brettle.Web.NeatUpload.ProgressPage"



Assembly="Brettle.Web.NeatUpload"



becomes



Inherits="Brettle.Web.NeatUpload.ProgressPage,Brettle.Web.NeatUpload,Version=1.3.3519.18793,Culture=neutral,PublicKeyToken=C95290D92C5893C8"



Assembly="Brettle.Web.NeatUpload,Version=1.3.3519.18793,Culture=neutral,PublicKeyToken=C95290D92C5893C8"



In the application web.config the following needs to be added.



IN <configuration><configSections> add

       <section name="neatUpload" type="Brettle.Web.NeatUpload.ConfigSectionHandler,Brettle.Web.NeatUpload,Version=1.3.3519.18793,Culture=neutral,PublicKeyToken=C95290D92C5893C8"

                 allowLocation="true" />



IN <configuration> add



<neatUpload xmlns="http://www.brettle.com/neatupload/config/2008" useHttpModule="true" />



The above two entries are really a holder at this stage, please review the manual for further options, but netupload can be configured by modifing this tag <neatUpload >.



IN <system.web><httpModules> add



<add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule,Brettle.Web.NeatUpload,Version=1.3.3519.18793,Culture=neutral,PublicKeyToken=C95290D92C5893C8" />



IN <system.webServer><modules> add



<add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule,Brettle.Web.NeatUpload,Version=1.3.3519.18793,Culture=neutral,PublicKeyToken=C95290D92C5893C8" preCondition="managedHandler"/>



With the above changes I was then able to create an aspx page with the following tags, this would then compile and allow me to add multiple files.





<%@ Register TagPrefix="Upload" Namespace="Brettle.Web.NeatUpload" Assembly="Brettle.Web.NeatUpload,Version=1.3.3519.18793,Culture=neutral,PublicKeyToken=C95290D92C5893C8" %>





       <Upload:MultiFile id="multiFileId" runat="server" UseFlashIfAvailable="true"/>


Share/Bookmark

7 comments:

  1. Hello! I am trying to do this. I have a post at http://stackoverflow.com/questions/10391657/how-to-install-neatupload with my error codes. I have followed along the best I could, but am getting an asp.net error
    Line 35: protected MultiFile multiFile;
    with a missing assembly reference. The dll is registered in the GAC okay, and the first few references seem to work fine. Any clues, Allan?

    ReplyDelete
  2. Allan - I figured it out. My answer is at: http://stackoverflow.com/questions/10391657/how-to-install-neatupload/10400485#10400485 Thanks for your guide.

    ReplyDelete
    Replies
    1. Hi BGM, sorry I did not get back sooner I have been away but I am glad to hear you got round your problem. I'll have a read through your issue and resolution when I get back. Cheers

      Delete
    2. This comment has been removed by the author.

      Delete
  3. Hello, Allan, thanks for answering! I knew this post had been around a little while, and noone had yet commented, so I figured I might not hear from you, but hey, I am joyfully wrong! Now, I only got so far getting that NeatUpload to work, and am beginning to be discouraged. Here is my new problem: http://stackoverflow.com/questions/10402552/how-to-overcome-this-neatupload-object-reference-error. I have started to look for other solutions, but am not finding what I need.

    ReplyDelete
    Replies
    1. Hi BGM, another negative I am afraid, I took a quick look and I'm afraid I can't see anything. Its been a few years since I have done any coding. I no longer have access to the environment I set this up on, to even begin to refreshing my memory and try and figure out whats going on.. (old age is a bitch.. :o) ).
      Cheers.

      Delete
  4. Thanks anyway. I appreciate your willingness.

    ReplyDelete