Author Topic: how can i change the upload directory  (Read 6030 times)

nuttynibbles

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
how can i change the upload directory
« on: 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.

cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
Re: how can i change the upload directory
« Reply #1 on: June 07, 2010, 01:15:50 pm »
Using Linux links could be a way

nuttynibbles

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: how can i change the upload directory
« Reply #2 on: June 08, 2010, 03:19:02 am »
is there anywhere in the configuration which I can hack?

cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
Re: how can i change the upload directory
« Reply #3 on: 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 :)

nuttynibbles

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: how can i change the upload directory
« Reply #4 on: June 08, 2010, 10:04:21 pm »
Hi cabeza,

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

regards,
christopher

cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
Re: how can i change the upload directory
« Reply #5 on: June 09, 2010, 10:20:07 am »
It would be nice if you could post how you did it, for future reference,.

masiqbal

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: how can i change the upload directory
« Reply #6 on: 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