Download & Extend

Upload / Access to a alias directory

Project:IMCE
Version:6.x-2.3
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Issue tags:imce

Issue Summary

Hi,
I am trying to Upload to a directory outside of drupal6 installation.
I have created a xampp alias to this directory in htpd.conf file (Alias /drupal/sites/default/files/1234 "C:\programming\dev", which succefully can be accessed via browser.
However IMCE, just can't see the alias directory :(.
Is there any other way arround, to solve this problem ?

Comments

#1

You should do it with a symlink. However, see #1008402: Allow the use of symlinks within the files directory. before.

#2

Thanks to pointing to the "right" direction. I succefullly created a symlink directory in specified directory and IMCE discovers it correctly. However I still unable uploading a file to it while getting error messages in move_uploaded_file() function line 628.

Also, I have installed a "take control" module which succefully access and upload files to symlinked folder.

Note: I am using a XAMPP on Windows, and symlink is created via junction.
Thanks in advance.

#3

Try 6.x-2.x-dev. It has a workaround for allowing symlinks, however it won't in Drupal 7 as it needs to be fixed in core.

#4

Hi,
I've tried 6.x-2.x-dev without success. I am using D6.
Next, I've modifed the file.inc as follows and it finally works!!!!!!

function file_check_location($source, $directory = '') {
// This file does not yet exist
    //$source = realpath(dirname($source)) .'/'. basename($source);

$check = realpath($source);
  if ($check) {
    $source = $check;
  }
  else {
    // This file does not yet exist
    $source = realpath(dirname($source)) .'/'. basename($source);
  }
   // Comment the following lines
   /* $directory = realpath($directory); 
  if ($directory && strpos($source, $directory) !== 0) {
    return 0;
  } */
  return $source;
}
nobody click here