MyBB Community Forums
Is there NO helper function in PluginLibrary 12 for uploads? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Development (https://community.mybb.com/forum-68.html)
+---- Thread: Is there NO helper function in PluginLibrary 12 for uploads? (/thread-184816.html)



Is there NO helper function in PluginLibrary 12 for uploads? - expat - 2015-10-13

Is there NO helper function in PluginLibrary 12 for uploads?

Its got the helper function for the forums and groups, it there no helper function for uploading images?


RE: Is there NO helper function in PluginLibrary 12 for uploads? - Euan T - 2015-10-13

I've not seen one, but uploads aren't particularly difficult to handle. What is it you're struggling to do?


RE: Is there NO helper function in PluginLibrary 12 for uploads? - expat - 2015-10-13

I am looking to add forums images either via link or uploads Toungue


RE: Is there NO helper function in PluginLibrary 12 for uploads? - Euan T - 2015-10-13

The upload_file function should help then: https://github.com/mybb/mybb/blob/feature/inc/functions_upload.php#L724

You can also take some ideas from upload_avatar to ensure the uploaded file is actually an image and is the correct size, etc. As such things depend on what you're doing exactly, it's quite difficult to write a generic helper.