I've got the Drupal file root as /files and I want WebFM to just use the same root, but putting a blank entry gives a "WebFM root not set" when I try WebFM, and if I try "/" the settings form says "The leading character of the webfm root directory name must be alphanumeric."

Is there any way to do this? I remember being able to do it in a 1.x version.

Thanks

Comments

robmilne’s picture

No, the rules changed such that using files as root is impossible. You'd have to hack the module to allow this.

ArgentOfChange’s picture

For myself, I can't seem to set my WebFM root directory (/webfm), even though the directory exists, I have the correct permissions and my file-system is A-OK. What could be wrong?

forrestbao’s picture

Yeah, I think this is a very bad problem. I don't wanna create another subdirectory under files directory.

sugiggs’s picture

I hack this module to make this work....

around line 807, my module will look like this

  //Get root directory of module
  if(empty($webfm_root_path)) {
    $webfm_root_path = variable_get('webfm_root_dir', '');
    $webfm_root_path = '/'.$webfm_root_path;
    /*
    if(empty($webfm_root_path)) {
      //WebFM root dir must exist
      webfm_json(array('status' => FALSE, 'err' => t('WebFM root not set')));
      exit();
    } else {
      $webfm_root_path = '/'.$webfm_root_path;
    }
    */
  }

around line 1499

        //if(variable_get('webfm_root_dir', '')) {
          // breadcrumb keeps file-sys root hidden
          $non_root_arr = explode('/', trim($path, '/'));
          foreach($non_root_arr as $piece) {
            $this->breadcrumb[] = $piece;
          }
        //}

Danai-1’s picture

Hmm, I'd suggest that you put "./' in your Filesystem settings, and "files" in WebFM.
Or would this create a security problem?

Cheers

/Danai

robmilne’s picture

Status: Active » Closed (works as designed)

The hack is very dangerous. The webfm root dir inside the Filesystem ensures that the modules that use the flat file-system cannot be tampered with.

Maitreya’s picture

osrry to old issue to comment on (besides i posted under different version)