best practice file/image upload in modules

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
simplebx
New Member
New Member
Posts: 1
Joined: Fri Feb 19, 2016 9:08 pm

best practice file/image upload in modules

Post 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
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1922
Joined: Mon Jan 29, 2007 4:47 pm

Re: best practice file/image upload in modules

Post 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.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Post Reply

Return to “Developers Discussion”