MultipleServerMode for NLB

Last post 09-29-2006, 11:11 AM by mkk14. 8 replies.
Sort Posts: Previous Next
  •  06-30-2005, 4:34 PM 8233

    MultipleServerMode for NLB

    In our Developement environment, we have only 1 Web server, so when we set the configuation XML files to use "~/images" for the ImageGalleryPath, there is not a problem for uploads and inserts.
     
    However, our production environment is 2 Web servers set up for NLB - What exactly does the MultipleServerMode attribute found in the Editor.confi file for? Does that mean, that when someone uploads an image or a file, it will save it to both servers? I can't seem to find any documentation anywhere about this.
     
    Thanks
  •  07-01-2005, 8:12 AM 8256 in reply to 8233

    Re: MultipleServerMode for NLB

    Hello:
     
    For the NLB environment , you should not store the uploaded file to FileSystem .
    Try to store the file to database instead .
    There are two sample to store the file to Access or SqlServer .
     
    Regards , Terry .
  •  07-01-2005, 10:24 AM 8263 in reply to 8256

    Re: MultipleServerMode for NLB

    Terry - Do you know where I can find those examples? - Thanks
  •  07-01-2005, 11:43 AM 8269 in reply to 8263

    Re: MultipleServerMode for NLB

  •  09-26-2006, 4:56 PM 23096 in reply to 8233

    Re: MultipleServerMode for NLB

    I am trying to do a similar thing and it would be a complete lazy hack to save images to a SQL or Access Database. 

    I am using Cute Editor for ASP.Net version 5.3.

    We have 2 servers that serve a load balanced site.
    This means that instead of c:/winnt/inetpub/oursite, or some such path, we have \\vserver\D$\oursite.

    I have setup a test script to ensure that we can actually write.
    In a nutshell, my test is powered by (and works using):
      filename.PostedFile.SaveAs("\\vserver\D$\oursite\someimage.gif");

    In Editor.config, I have set:
      <setting name="MultipleServerMode" value="True" />

    In Default.config, I have set:
      <security name="ImageGalleryPath">\\vserver\D$\oursite</security>

    The error returned is (with Stack Trace and Version Info):
      Unable to translate physical path \\vserver\D$\oursite to virtual path

    Stack Trace:
      [Exception: Unable to translate physical path \\vserver\D$\oursite to virtual path]
       CuteEditor.EditorUtility.ProcessWebPath(HttpContext context, Control ctrl, String path) +692
       _ASP.gecko_insertimage_frame_aspx.InitOfType() +34
       CuteEditor.Dialogs.FileBrowserPage.OnInit(EventArgs e) +713
       System.Web.UI.Control.InitRecursive(Control namingContainer) +241
       System.Web.UI.Page.ProcessRequestMain() +197

    Version Information:
      Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300


    Any help would be greatly appreciated.

  •  09-26-2006, 5:32 PM 23098 in reply to 23096

    Re: MultipleServerMode for NLB

  •  09-28-2006, 9:54 AM 23150 in reply to 23098

    Re: MultipleServerMode for NLB

    From my clients IS Dept:
    UNC path is the only method of doing it since we are running load balanced.  Because of this, we NEED to upload to a
    remote folder or the file uploaded will only hit the server the user is on at that moment.  The solution sent is creating a virtual directory which is not going to help since we cannot create a virtual on the production server that points to \\vserver.  That is not permitted in IIS (moreso, no one would ever have a conceivable reason to do it, so I think it is just unsupported).

    I'm a programmer and the server side stuff is peripheral to my expertise. I understand what my client's IS dept saying and my moderate knowledge agrees that the link Adam sent me to wouldn't do the trick. In looking at that solution in the first place, the logic didn't add up to me which is why I asked someone else -- to be sure.

    I'm giving up on this and am going to write my own Image Uploader. I'm pretty sure I can still use the Image Gallery as long as I strip the file uploading and modifying (i.e. deleting) and make it readonly. 

    I'm posting this only for the benefit of anyone else in my situation - the noticable drought of feedback in this areana made it seem that I was creating the wheel.



  •  09-28-2006, 2:20 PM 23175 in reply to 23150

    Re: MultipleServerMode for NLB

    mkk14,
     
    For your situation, I suggest you either store the images/files into database or map the UNC path to a virtual directory.
     
    If it's required to use UNC path in your project, you can create a custom button(client side) which displays a dialog. In this dialog, you can put on you own Image Gallery/Uploader.
     
    Add a Cross Browser Modal Dialog Box to Cute Editor

    How to create a custom button(client side) which displays a dialog?( C# | VB )

    This example demonstrates how easy it can be to add your own client side buttons to the CuteEditor by creating a Cross Browser Modal Dialog Box.

     
     
    Keep me posted
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  09-29-2006, 11:11 AM 23204 in reply to 23175

    Re: MultipleServerMode for NLB

    Adam, Thanks for your efforts, but I had to customize a solution.
    I'll post it here for anyone else in my situation.
    You don't need to address it any further, I'm satisfied with where I'm at.

    Since we'll be dealing with nearly 20,000 images, the database option is not an option.
    The UNC path is also not an option in our environment.

    1. ~ I set "AllowUpload", "AllowRename", "AllowDelete" etc. all to false. Any Allow* that would look for that path.

    2. ~ (optional) Then in the Dialogs, every Dialog aspx file that had "fileUpload" as an id, I set to hide. Changing them to 'false' doesn't hide them, it only disables the Browse and Upload buttons, which I thought was a little ugly.

    This had to be done in two ways - For the ones that had "runat=server" in the fieldset with the id="fileUpload", I added this line above it (I'm showing the actual fieldset line for explanation purposes.)

      <% if (!secset.AllowUpload) { fieldsetUpload.Visible = false; } %>
      <fieldset runat="server" id="fieldsetUpload">

    For the ones that had no runat="server", I added an if clause.

      <fieldset id="fieldsetUpload" <% if (secset.AllowUpload) { %>style="display:none;"<% } %> >
     
    3. ~ I then modified the dialogs (like 15 of them, I think) so that when the fieldset was hidden, there was a link to "Upload Images" - a page I created cased upon the next step...

    4. ~ That link led to a script I got from 15seconds.com called "Creating a File-Upload User Control with ASP.NET"

    And, voila, we have a winner. 
View as RSS news feed in XML