Hello Joomlapolis Community!
I have been developing an app using react-native and using APIs I have been creating using COM_API.
So far, everything is going great, but now I am blocked by how to store an image uploaded from the app.
The app part is done, and the image is received by my API server perfectly fine, but I am trying to use CB APIs to store the Avatar in the best way possible.
I have been checking this class:
class CBfield_image extends cbFieldHandler in cb.core.php to see if I can use its functions to verify and store safely the image sent from the app, but I have not been able to do it.
In my API end-point I am calling all the CB framework and even the GJ framework to try to get to that class, but no luck so far:
Code:
// CB load
global $_CB_framework, $mainframe;
if ( defined( 'JPATH_ADMINISTRATOR' ) ) {
if ( ! file_exists( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' ) ) {
return;
}
require_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' );
} else {
if ( ! file_exists( $mainframe->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/plugin.foundation.php' ) ) {
return;
}
require_once( $mainframe->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/plugin.foundation.php' );
}
cbimport( 'cb.html' );
if ( ! file_exists( $_CB_framework->getCfg( 'absolute_path' ) . '/components/com_comprofiler/plugin/user/plug_cbgroupjive/cbgroupjive.class.php' ) ) {
return;
}
require_once( $_CB_framework->getCfg( 'absolute_path' ) . '/components/com_comprofiler/plugin/user/plug_cbgroupjive/cbgroupjive.class.php' );
I have tried via
Code:
CBuser::getMyInstance();
and have tried to get the CBuser:
methods available, hoping there is something like CBuser::updateAvatar($_FILE, $user) or something miraculous like that.
Please help
:blush:
Cheers!