Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change default upload folder
#6
I don't know if anyone has documented this yet, but this is how I almost successfully changed the admin code to accept a new "upload" directory. I say almost because I haven't really done an extensive test, but everything works so far. Using the changes below, I am able to add/edit/delete directories, upload/delete files, and use the file browser feature of the WYSIWYG system.

If this is truly all that was needed to be done (again, I haven't tested it extensively), then some simple changes to the code in the next release can give people the opportunity to change their uploads directory more easily. It would be nice to simply use the GSDATAUPLOADPATH definition.

NOTE: I'm changing the upload directory from uploads to public in GS version 3.1.2.

IN admin/inc/common.php
  • LINE 52: define('GSDATAUPLOADPATH', GSROOTPATH. 'data/public/');

IN admin/upload.php
  • LINE 20: $path = tsl("../data/public/".$path);
  • LINE 24: $path = "../data/public/";
  • LINE 64: ... <a href="'. $SITEURL .'data/public/'.$subFolder.$base.'">'. $SITEURL .'data/public/'.$subFolder.$base.'</a>';
  • LINE 196: echo '<div class="h5 clearfix"><div class="crumbs">/ <a href="upload.php">public</a> / ';
  • LINE 236: $adm = substr($path . $upload['name'] , 15); // used to be 16

IN admin/image.php
  • LINE 25: $src_folder = '../data/public/';
  • LINE 73: ... <?php echo tsl($SITEURL) .'data/public/'. $subPath. $src; ?> ...
  • LINE 77: ... <?php echo tsl($SITEURL) .'data/public/'. $subPath. $src; ?> ...
  • LINE 78: ... <?php echo tsl($SITEURL) .'data/public/'. $subPath. $src; ?> ...
  • LINE 81: ... <?php echo tsl($SITEURL) .'data/public/'. $subPath. $src; ?> ...

IN admin/filebrowser.php
  • LINE 18: $path = (isset($_GET['path'])) ? "../data/public/".$_GET['path'] : "../data/public/";
  • LINE 27: $fullPath = $sitepath . "data/public/";
  • LINE 129: $adm = substr($path . $upload['name'] , 15); // used to be 16

NOTE
The substr changes relate to the length of the directory name. Uploads has 7 letters, public has 6 letters (so 16-1=15).
Reply


Messages In This Thread
Change default upload folder - by datiswous - 2012-03-01, 09:02:05
RE: Change default upload folder - by shawn_a - 2017-12-09, 00:37:28
RE: Change default upload folder - by MaryUser - 2017-12-09, 10:02:52
RE: Change default upload folder - by jjancel - 2024-03-07, 02:45:44
RE: Change default upload folder - by islander - 2024-03-07, 03:17:53
RE: Change default upload folder - by jjancel - 2024-03-07, 04:35:45
RE: Change default upload folder - by islander - 2024-03-07, 19:27:46
Change default upload folder - by Connie - 2012-03-01, 18:35:24
Change default upload folder - by ccagle8 - 2012-03-02, 02:18:37
Change default upload folder - by datiswous - 2012-04-02, 10:00:56
Change default upload folder - by benrusso - 2012-08-21, 06:23:32
Change default upload folder - by benrusso - 2012-09-07, 08:39:06
RE: Change default upload folder - by MaryUser - 2017-12-08, 15:59:54



Users browsing this thread: 1 Guest(s)