Page 1 of 1

best practice file/image upload in modules

Posted: Fri Feb 19, 2016 9:24 pm
by simplebx
Hi,

the new development tutorial inspired me to develop my first cmsms module. Ty for the effort to write and publish it! :)

Actually I'm stuck on a basic design issue: I want the admin user to upload images and data in my module backend and just asked my self, if I have to build all the code for the upload, sanitize, conversion and resizing myself, if the fileManager module does it quite well already.

Similar to this old topic: http://forum.cmsmadesimple.org/viewtopic.php?f=6&t=6249

I checked the code of the fileManager module, but couldn't find any obvious hook, so I ask for your best practice or even a tutorial, how to solve uploads in cmsms modules.

Any help is appreciated
J-C

Re: best practice file/image upload in modules

Posted: Fri Feb 19, 2016 10:12 pm
by Jo Morg
simplebx wrote: I checked the code of the fileManager module, but couldn't find any obvious hook, so I ask for your best practice or even a tutorial, how to solve uploads in cmsms modules.
At the moment, FileManager doesn't have a proper API to hook into so, even if possible, it's not yet supported. We are working on implementing it for the next version of CMSMS, so that module developers can use a core file picker, integrated in FileManager, but usable from other modules.
Having said that, and until then, you have currently 2 options:
- for CMSMS 1.1x branch you can use either GBfilePicker or JMFilePicker;
- for CMSMS 2.x branch you only have (afaik) JMFilePicker;
In any case stay tuned for version 2.2 of CMSMS as it will have an API for a File Picker to be used by 3rd party modules.