Feng Forum

Other Topics => Development => Community Contributions => : nuttynibbles May 29, 2010, 05:33:17 PM

: how can i change the upload directory
: nuttynibbles May 29, 2010, 05:33:17 PM
hi,

i understand the upload directory is in the main. but how do i change this to somewhere else in the same server?

thanks.
: Re: how can i change the upload directory
: cabeza June 07, 2010, 01:15:50 PM
Using Linux links could be a way
: Re: how can i change the upload directory
: nuttynibbles June 08, 2010, 03:19:02 AM
is there anywhere in the configuration which I can hack?
: Re: how can i change the upload directory
: cabeza June 08, 2010, 06:42:43 PM
Not in configuration.

Repository path is set in the constructor of the class FileRepository_Backend_FileSystem.

You should hack everywhere this class is instantiated (search for "FileRepository_Backend_FileSystem" in the code) ... At your own risk :)
: Re: how can i change the upload directory
: nuttynibbles June 08, 2010, 10:04:21 PM
Hi cabeza,

tks for the info. will be working on it =)

regards,
christopher
: Re: how can i change the upload directory
: cabeza June 09, 2010, 10:20:07 AM
It would be nice if you could post how you did it, for future reference,.
: Re: how can i change the upload directory
: masiqbal March 13, 2011, 01:39:04 AM
the express way:

open /config/config.php

add:

define( 'MY_OWN_UPLOAD_DIR' , 'my/own/dir' );

open lib/filerepository/backend/FileRepository_Backend_FileSystem.class.php

find function getRepositoryDir and setRepositoryDir, then change to:

function getRepositoryDir() {
      //return $this->repository_dir;
      return MY_OWN_UPLOAD_DIR;
   }

function setRepositoryDir($value) {
      if(!is_null($value) && !is_dir($value)) {
         throw new DirDnxError($value);
      } // if

      /*if(!folder_is_writable($value)) {
         throw new DirNotWritableError($value);
      } // if*/

      //$this->repository_dir = $value;
      $this->repository_dir =MY_OWN_UPLOAD_DIR;
   } // setRepositoryDir