Is there any callback I can use to append $uploadPath or $publicPath to the auto generated filename? If I didn’t store $uploadPath or $publicPath how can I retrieve the uploaded image outside GCE pages?
I am working currently in having the callbackBeforeUpload, callbackUpload and callbackAfterUpload and I am going to release that very soon (e.g. this week). Maybe what are you looking for is a callbackUpload or a callbackAfterUpload so you can change the filename? I will inform you once the functions are available to see if this fits your needs. Also what about using the callbackAfterUpdate instead?
For example having something like this:
$crud->callbackAfterUpdate(function ($stateParameters) use ($callbackAfterUpdateModel) {
$prefix = 'test-';
if (!empty($stateParameters->data['photo_url']) && !strstr($stateParameters->data['photo_url'], $prefix)) {
$photoUrlWithPrefix = $prefix .$stateParameters->data['photo_url'];
// Create your own model and update the photo url
$callbackAfterUpdateModel->updatePhotoUrl($stateParameters->primaryKeyValue, $photoUrlWithPrefix);
}
return $stateParameters;
});