Good morning!
I'm coding a class for using when a form is sent (using processFormData hook). In the form, some files could be uploaded (usually an image file). I configured in the backend that the file uploaded is stored in certain directory. The idea is to generate a news item with this form data.
I need to know, when hook 'processFormData' is triggered, the
singleSRC of the form uploaded file for writing it in tl_news table. What's the easier way?
I'm trying to get that singleSRC from array
$arrFiles, but I don't know how this array works. If it's not possible to directly read the singleSRC, it could be useful to know (at least) the file name (note: in formgenerator (backend) i check the option 'don't overwrite existing files', so probably the system will add a number at the end of the original file name. On that case, I could use something like this (I found it searching...):
Code:
$file = Dbafs::addResource($fileName);
$set = Dbafs::syncFiles();
$singleSRC = $file->uuid;
I appreciated any help. Thanks a lot!
Bookmarks