I need to have my file attachments set to private, however, I want some files to be available publicly. I've set my file attachments to private, and want to have the editor attachments public. So, they will need to go into a different directory. How can I change the default directory for ICME so that the files do not go into the system directory?

Thanks!
k

Comments

StevenWill’s picture

I also need to be able to have the directory be different than the system directory for a specific user. I noticed on line 40 of core_profiles.inc the profile is set for directories. Anyone know what edit is needed.
Steve

TechMosaic’s picture

I just want to lend my support for this idea.

I don't need it for security per se, but I would love to be able to point to a folder on my web server other than one in the drupal default files folder.

Could the directory setup give you the option to add a directory using a ../newfolder so it looks to the root, or a http://www.mysite.com/newfolder so it uses a FQDN to view a folder, as long as the folder is not protected via an htaccess or other security method??

I see that PHP: can be used there. Maybe there is a hack for folks like me who just want flexibility with folder structures, and don't care about the security issues...I just don't know php well enough to figure out what that should be.

hansamurai’s picture

I am also really interested in something like this. I would even be useful if someone could help me hack the code if they don't want to add this to the mainline.

Update: I was able to hack away at page.inc by replacing all references to "file_directory_path()" with a string reference to my intended path. This is working so far.

ufku’s picture

Status: Active » Fixed

use hook_init to change the value of
$GLOBALS['conf']['file_directory_path']

hansamurai’s picture

Does that change it permanently or just locally?

ufku’s picture

The change is specific to current request.
It can be made specific to imce path

if (arg(0) == 'imce') {
  $GLOBALS['conf']['file_directory_path'] = 'public-files';
  $GLOBALS['conf']['file_downloads'] = FILE_DOWNLOADS_PUBLIC;
}

This should also work in template.php without a hook_init

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.