Question

How can I use Moxiemanager to upload images to a different server? Basically I have a server that uses this plugin, but I need to upload images to a different server.

For example: A user uses the moxiemanager from a server with a domain like www.normalserver.com, when the user uploads an image, I need to push that image only to www.filesystemserver.com. I will implement lsync on www.filesystemserver.com so, when I show the images I will show it from www.normalserver.com/path/to/image.jpg.

I already use filesystem.local.urlprefix to configure a different url for images.

I was reading the documentation to configure the Moxiemanager: http://www.moxiemanager.com/documentation/index.php/Configuration and I don't find any configuration for what I want.

Was it helpful?

Solution

Ok, I fixed this issue with a hack on a MoxieManager js variable. By doing:

moxman.Env.baseUrl = "PATH_TO_OTHER_SERVER/tinymce/plugins/moxiemanager";

After the tinyMCE initialize. The completed code is:

tinymce.init({
          ..... //options
          init_instance_callback: function () {
            moxman.Env.baseUrl = "PATH_TO_OTHER_SERVER/tinymce/plugins/moxiemanager";
          }
});

If you see a login popup when you open the Moxiemanager, take a look of your configuration file, if you have the authenticator key as SessionAuthenticator , you should share the session variables between both servers. Maybe you will need to make some changes on your Apache Config by adding some Headers such as :

Header set Access-Control-Allow-Headers: "Origin, X-Requested-With, Content-Type, Accept"
Header set Access-Control-Allow-Origin: "http://DOMAIN_OF_YOUR_SERVER"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top