The File Browser and Uploader work just dandy when I install FCKeditor on a single site. However, I haven't been able to get the browser or uploader to work on a Drupal subfolder multisite install.

Drupal subfolder: /drupal63 (at the root)
FCKeditor install location: /drupal63/sites/all/modules/fckeditor
Example site location: /drupal63/sites/example.com
Example site "files" location: /drupal63/sites/example.com/files (/file, /image, /media, /flash)
Example site image file: /drupal63/sites/example.com/files/image/test.jpg
Desired outcome - Image is sourced as follows: http://www.example.com/files/image/test.jpg

I've tried just about everything. The best I've been able to do (with the myriad of configuration files and settings) is to have files stored "centrally" at /drupal63/files/... but this allows any site to see the other sites' files. Does anyone have a step-by-step process for allowing multiple sites to share the module, yet be under a root-level subfolder AND store their site-specific files in their own "files" folders?

Comments

talktozee’s picture

Some progress...

I've added the /drupal63 subfolder to the FCKeditor Advanced Profile's "File browser settings, Absolute path to uploaded files" setting only. This (at a minimum) does some magic to make images upload to the proper directory and be sourced "absolutely". An example is here: http://www.jessicaping2008.com/

Note that the picture shows, but if you view the image by itself (easy in Firefox, right-mouse click, View Image) you'll see the path in the address bar.

This is a step in the right direction, but is there any way of making it the way I want it, i.e. http://www.jessicaping2008.com/files/image/jessica-ping.jpg ?

jastern’s picture

hi, talktozee,

i'm only seeing your post now, so sorry for the delay.

i'm not a coder -- just another end-user/drupal-admin. but the way i've gotten this to work is by installing the IMCE module (http://drupal.org/project/imce), then setting IMCE as the preferred file browser for FCKeditor. IMCE has what it calls "Configuration Profiles" for how you want it to run. you can set up more than one IMCE configuration profile, but i only set up one, and then i associate that IMCE Conf. profile with all the Drupal Roles that can post and upload to my sites (i too, have a multi-site setup, but i use the Domain Access module -- http://drupal.org/project/domain).

anyway, in the setup for the IMCE configuration profile, IMCE lets you use a little bit of php to auto-calculate the default upload path the user will see in their IMCE file browser when it pops up:

DIRECTORY PATH:
files/ [php: global $base_url; return substr(str_replace('https','http',$base_url),7).'/images';]

this way, the poster (whose role is associated with this IMCE profile), using the FCKeditor, will be taken to /files/www.example.com/images if they are using that domain, but another poster using the same profile, but logged in to www.example2.com, will be taken automatically to /files/www.example2.com/images when they open the IMCE file browser through FCKe. so they will each deposit their images in different subdirectories, and FCKeditor will create HTML referencing the different, appropriate subdirectories correctly.

this way i can set up the /files folder to have subfolders by site name, and then under that, content type (images/flash, etc.) and it works.

also, this method won't get your URL sourced out exactly the way you want it. instead of http://www.example.com/files/image/test.jpg it would show up as http://www.example.com/files/www.example.com/images/test.jpg

hope this helps.

tmallen’s picture

I found a fairly reasonable fix for this, in 5.x anyway. This client had all file uploads going to the correct directories, but the links would point to /files

I fixed it in .htaccess. You'd want to add this after the main index.php RewriteRule (which excludes static files):

  RewriteCond %{HTTP_REFERER} ^http://www.mysite.org/subsite/
  RewriteRule ^files/(.*)$ sites/www.mysite.org.subsite/files/$1

You'd need to add that for every sub-site. I'm sure there's a more elegant way to write it so that it would apply to all sites, but this works well.

Jorrit’s picture

Status: Active » Closed (fixed)

Closed because of inactivity. I hope new versions solve the problems, if there are still any.