How to add a file programatically?

Permalink
My Concrete5 block creates a PDF file and I would like to add it programatically to the File Manager. Is there a snippet of code that shows how to do that?

Many thanks...

Todd

rtcary
 
rtcary replied on at Permalink Reply
rtcary
I found the answer in the 5.6 documentation. Now I need to find out how to get the fileID knowing the name of the file. Suggestions welcomed...

Todd
nebuleu replied on at Permalink Reply
nebuleu
To find a File object with a filename, you can use the FileList->filterByKeywords() method.

Documentation about FileList :
http://www.concrete5.org/documentation/developers/5.6/files/searchi...