FreeTextBox

The no. 1 free ASP.NET HTML Editor.
Welcome to FreeTextBox Sign in | Join | Help
in Search

ImageGallery cross-subdomains

Last post 09-26-2008, 2:43 AM by mark_wells. 3 replies.
Sort Posts: Previous Next
  •  09-21-2008, 11:28 PM 9464

    ImageGallery cross-subdomains

    Here's my situation. We would like to use the ImageGallery to save the images to a different subdomain. This separate subdomain is located on a different server from the one that serves the FreeTextBox. I tried a number of different configurations, and I couldn't get it to work.

    Basically, we have www.domain.com, which serves the content with the images. We also have admin.domain.com, which allows users to edit the content. These two sites are served from different servers.

    So first, I tried putting both the page with the FreeTextBox control, and the page with the ImageGallery control on admin.domain.com. Then I tried to set the CurrentImagesFolder property to full path of the other server (\\server\images). This didn't work. The ImageGallery control threw an exception, because it's basically appending that path to it's own path, rather than treating it as an absolute path.

    So next, I tried putting the ImageGallery page on our public webserver (www.domain.com). But the FreeTextBox page still must be on the admin page (admin.domain.com). I got further with this option, but it still fails. I get a JavaScript error when I try to insert an image into the FreeTextBox. The reason is the browsers security policies restricting cross-domain Javascript calls.

    However, these two pages are on the same domain, just different sub-domains. I found a trick to call

    document.domain = 'domain.com'

    from both pages. However, I now I still get Javascript security errors, when the FreeTextBox is initializing.

    Has anyone successfully got FreeTextBox and ImageGallery to work on different subdomains? I would be most appreciative for a solution to this problem.

    Thanks
    Rick
  •  09-25-2008, 9:40 PM 9478 in reply to 9464

    Re: ImageGallery cross-subdomains

    I think you could be banging your head for a long time trying to find a javascript solution (been there, done that). This type of problem should be solved on the server side.

    I have not worked with the ImageGallery yet, but I suspect that the upload of images comes with a server event that can be caught (if not, then you can create one). At that time, you should be able to access your sub-domains and save to the appropriate folder. Since they are on different servers you may have to look at how to transfer the data from the view content domain to the edit content domain.

    It strikes me that your architecture may be more complicated than it needs to be. Can you not host all functionality on one web server (with the same web application) and implement roles to allow view, add, update and delete functionality to decide who gets to do what? 

    Just a thought.

    Mark

  •  09-26-2008, 12:39 AM 9479 in reply to 9478

    Re: ImageGallery cross-subdomains

    Thanks for your reply. Unfortunately, I'm afraid your suspicion is incorrect. The image gallery has been designed to be a completely self-contained control. That is, it does not expose any events that one can subscribe to. Further, you mention that our server configuration is overly-complicated (unfortunately, our network admins won't let us change it), but the thing is, it doesn't even matter if my desired location to save the images is on the same server. The image gallery won't even let me save the images on the same server, but outside the web application folder.

    However, I've found that most rich text editors that have image galleries behave this way. They do not offer the ability to save images outside the web application's root folder.

    I ended up writing my own image gallery control that does offer this ability, and integrated it with the FreeTextBox control. It seemed to do the trick.
  •  09-26-2008, 2:43 AM 9481 in reply to 9479

    Re: ImageGallery cross-subdomains

    Good Job Theram!! Sometimes we need to take things into our own hands; no matter what we are given or who says we need to do it a certain way.

    Right On!!

View as RSS news feed in XML
www.freetextbox.com