I have a database of Children's Art with three tables. Each row in each of these tables contains an image plus data associated with the image (Artist, Age, Date, etc.).
Each of the three tables contains a few hundred images, and growing.
Because each table is a separate collection, I'd really like the images associated with each table to be stored in a separate directory.
Right now, all images from all tables are stored in a single directory called "images".
Is there a way to specify a different directory for each table? Where in the code is the directory determined?
Thanks for any help,
Garry Musgrave
Specifying An Image Directory
Re: Specifying An Image Directory
You can change the upload directory easily in defaultLang.php
Edit this line (around 14) : $Translation['ImageFolder'] = './images/';
Individual folders for individual tables might involve a bit more work to achieve but it looks possible.
I haven't tried it but I see Uploads are controlled in lib.php by this function (somewhere around line 144):
There's an array in link.php
and the getUploadDir function in each tables" tablename_dml.php
I would imagine you could create a new "function getUploadDir", "function getUploadDir1", "function getUploadDir2", etc for each table and then add new $Translation['ImageFolder'] = './images1/'; etc in defaultLang.php, change the array in link.php and edit tablename_dml.php?
I can't think of a simpler way to do it but would welcome any other suggestions myself. I now have image folders on some old Appgini projects that have hit 2gb. Perhaps a future upgrade suggestion for Appgini would be the ability to specify an upload folder? Even better to separate image uploads from document uploads or even on per basis rather than per table?
Edit this line (around 14) : $Translation['ImageFolder'] = './images/';
Individual folders for individual tables might involve a bit more work to achieve but it looks possible.
I haven't tried it but I see Uploads are controlled in lib.php by this function (somewhere around line 144):
Code: Select all
function getUploadDir($dir){
Code: Select all
$p=array(
'tablename' => array(
'fieldname' => $Translation['ImageFolder'],
'fieldname2' => $Translation['ImageFolder'],
I would imagine you could create a new "function getUploadDir", "function getUploadDir1", "function getUploadDir2", etc for each table and then add new $Translation['ImageFolder'] = './images1/'; etc in defaultLang.php, change the array in link.php and edit tablename_dml.php?
I can't think of a simpler way to do it but would welcome any other suggestions myself. I now have image folders on some old Appgini projects that have hit 2gb. Perhaps a future upgrade suggestion for Appgini would be the ability to specify an upload folder? Even better to separate image uploads from document uploads or even on per basis rather than per table?
Re: Specifying An Image Directory
Thanks peebee. That's a big help, and should point me in the right direction.
It looks like some custom coding will do what I want, but the disadvantage, as always, is that updates to AppGini clobber the custom code, and it needs to be reinstated in the new version.
Personally, I'd like to see the upload directory as an option in AppGini on the "Media" tab where you set the field to be an "Image." The "Configure..." button brings up a number of options for this field, and this is where I think it should be able to be specified.
Maybe this will be included in a future update. I've reiterated this as a request in "Feature Suggestions."
It looks like some custom coding will do what I want, but the disadvantage, as always, is that updates to AppGini clobber the custom code, and it needs to be reinstated in the new version.
Personally, I'd like to see the upload directory as an option in AppGini on the "Media" tab where you set the field to be an "Image." The "Configure..." button brings up a number of options for this field, and this is where I think it should be able to be specified.
Maybe this will be included in a future update. I've reiterated this as a request in "Feature Suggestions."