Get file upload value after form submission using a form plugin

kostigas

New Member
Hello,

I'm using the file_upload element to upload images via a form. After form submission I want to generate thumbnails for the uploaded image. I tried to run a php plugin on after form process, I call a function that generates those thumbnails with the below syntax:

functionName({element_name});

I am sure that the function works properly because if I write directly the path of an image as a function parameter ( eg. functionName('path/to/image') ) then it successfully generates the thumbnails for all the sizes that I want. However If i use the: {element_name} so that this functionality runs for each image that is being uploaded then it returns a notice that the index is undefined.

What am I doing wrong?
 
Thanks, yes I know I can create thumbnails directly from the element settings. However I wish to create many sizes for each uploaded image, in the settings I can see that only one size can be defined. When should I use the {element _name} syntax. I can see that for some elements it works but not for all. For example if I try to get the value of a text field then the syntax works.
 
Simple placeholders {} may not contain what you expect for complex elements (may be an array etc).
So use one of the methods given in the WIKI.
 
Thank you. I found a workaround by refering to the element data as: $this->data['table___element_name'] and it worked.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top