HI there,
I have noticed that Silverstripe will not 'know about' files that are uploaded via the FTP until I 'look for new files' in the Files & Images tab of the CMS.
Is there a way to change this behavior?
The reason is that we have a process that automatically/periodically creates some files (exe's and tar.gs's) and uploads them to a folder under 'assets'. I'd like these to instantly be available on the web front end. i.e. I want to eliminate this step of having to log into the CMS and 'looking for new files' every time I add or remove a file through the FTP via the automated process.
Any ideas?
Thanks
Liam
PS, here is a sample of my code in case it is useful...
Page.php file has a nuber of functions within the Page class that looks for these files, e.g.:
function GetTheFiles() {
return DataObject::get(
$name = 'File',
$filter = "ClassName = 'File' and Filename like 'assets/subfolder/subfolder2/%-nz-win-%'",
$sort = "Name ASC",
$join = "",
$limit = "4"
);
}
And the Page.ss template then displays them, e.g.:
<% control GetTheFiles %>
<li class="win"><a href="$URL">$Title</a></li>
<% end_control %>