Saltar navegación

[Resuelto] Limit multiple image upload size into CRED form

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

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 support ticket is created 2 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

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 -

Zona horaria del colaborador: America/Sao_Paulo (GMT-03:00)

Etiquetado: ,

Este tema contiene 1 respuesta, tiene 2 mensajes.

Última actualización por Mateus Getulio 2 years, 2 months ago.

Asistido por: Mateus Getulio.

Autor
Mensajes
#2690771

Hi,
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?
Regards

#2690825

Mateus Getulio
Colaborador

Idiomas: Inglés (English )

Zona horaria: America/Sao_Paulo (GMT-03:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

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

I hope this helps and please let me know if you need any further assistance around this.

Best regards,
Mateus