Problem:
I have a CRED module in which the user can upload photos. I would like to limit the size of each file to 5 MB and also the format. How can I do this?
Solution:
To apply validation on the uploaded file's type and size, you can use the "cred_form_validate" hook:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate
You'll find a good example of this hook's usage in this reply:
https://toolset.com/forums/topic/restricting-file-size-and-types-on-file-upload-cred-form/#post-1411409
Relevant Documentation:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | - |
- | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | - |
Supporter timezone: America/Sao_Paulo (GMT-03:00)
This topic contains 1 reply, has 2 voices.
Last updated by 8 months, 3 weeks ago.
Assisted by: Mateus Getulio.