Loading...
 
Skip to main content

Features / Usability


File Gallery Update script

I have attached a handy script to update a file gallery. It is meant to be a command line script and not run from a browser. You give it the name of the file to upload, the user name and the gallery ID number as parameters.

Put the upload file in the tiki file gallery directory and the it is run so

php tikiFGUpload.php <filename> <user> <fileGalleryId>
e.g
php tikiFGUpload.php myfile admin 6

In my situation I want to make a set of file available to tikiwiki users at certain time of the day. Crontab (unix) is used to first copy the files into the tikiwiki file directory and then the php script is run. The script updates the file gallery with the new file items. If a file in the tiki directory is changed then the tiki upload file will be changed when the script is run.

For this to work tiki-fileGalleries must be in directory mode rather than storing files in the mysql database.

The script is based on a similar routine by Damian Parker but does a little more file checking.