Hi @kbliang,
I hope this message finds you well.
Can the forminator media folder work fine with any image compression plugin?
Yes, as it’s saved in the uploads directory, any image optimization plugin should work fine.
I have asked the Formiantor team for clarification regarding the first two queries. We’ll update you here once we have more feedback on this as soon as possible.
Kind Regards,
Nebu John
Hi @kbliang,
The Forminator team has provided an update regarding your query.
Image validation is performed before the file is uploaded to ensure security. For single file uploads, the upload is processed during form submission. For multiple file uploads, the process depends on the selected upload method.
When images are moved to the final Forminator folder, thumbnails are generated automatically.
Unfortunately, there are no settings or hooks available to control the size or number of thumbnails generated.
If you have additional questions or require further clarification, feel free to let us know. We’re here to assist!
Best Regards,
Nebu John
Thanks for your reply. I’m using multiple file uploads + Ajax. And only the process of this setting combination is discussed below. Two questions:
- I noticed that when the image thumbnails appear ( after I dragged the files and uploaded them ), the files have been uploaded to the temp folder with a random prefix. Does this mean that the files in the temp folder have been verified? After the form is submitted, the only thing that is performed on the media is the generation of thumbnails without any additional validation. Is this correct?
- Does forminator use its own function to generate thumbnails or is it a built-in function of WordPress? If it is a wp function, I can adjust it myself.
Thanks!
Hi @kbliang,
I hope this message finds you well.
I’ve reached out to the Forminator team for clarification on the follow-up queries. We’ll provide an update here as soon as we receive their feedback.
Best Regards,
Nebu John
Hi @kbliang,
We have an update from the Forminator team.
The files will be validated both before they are uploaded to the temporary folder and during form submission. Once the submission is complete, thumbnails are generated.
For generating thumbnails, we use a built-in function to ensure efficient and reliable processing.
I hope that helps. If you have any further questions, feel free to let us know!
Best Regards,
Nebu John
Thanks for the reply. My requirement is that for some forms, I want to perform updates instead of adding new ones. So my original idea was to intercept the form data: through apply_filters(‘forminator_prepared_data’, self::$prepared_data, self::$module_object).
Perform updates and block new additions, but this seems to have security issues.
I’m wondering if there is a hook for after the form is submitted that can extract the validated data (including media), perform the update, and then prevent the submission.
Thanks!
Or, has the $prepared_data in ‘apply_filters(‘forminator_prepared_data’, self::$prepared_data, self::$module_object)‘ already completed validation? If yes, then this problem is solved.
Thanks!
Hi @kbliang
I asked our development team for further information. We will get back to you once have further updates.
Kind Regards
Amin
Hi @kbliang
We got further feedback from our development team.
The hook forminator_prepared_data triggers before validation. You can try using the hook forminator_custom_form_submit_before_set_fields, which triggers after validation and file upload but before adding entry data.
You can search for it in the plugin files to learn more about how it works.
Best Regards,
Amin
After some testing, the hook seems to work ideally, thanks!