Please Log in to join the conversation.
Please Log in to join the conversation.
$item = new \CB\Plugin\Gallery\Table\ItemTable();
//var_dump($input);
$item->set('user_id', $user->id);
$item->set('value','');
$item->set( '_input', $input );
$item->set( '_files', $input->getNamespaceRegistry( 'files' ) );
$item->discoverType();
$item->store();
Please Log in to join the conversation.
Please Log in to join the conversation.
This is exactly what I do as I'm using Postman Post to testIf this is from JavaScript the easiest way to do this is create a FormData object and add the file input data to it
const formdata = new FormData();
formdata.append("token", "xxx");
formdata.append("file", fileInput.files[0], "test.pdf");
formdata.append("gallery_privacy[]", "99");
const requestOptions = {
method: "POST",
headers: myHeaders,
body: formdata,
redirect: "follow"
};
fetch("https://devel.cercle.business/index.php?option=com_comprofiler&view=pluginclass&plugin=cbautoactions&action=action&actions=340", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
Please Log in to join the conversation.
Please Log in to join the conversation.