• Resolved blackeye0013

    (@blackeye0013)


    Hi,

    I need to limit uploaded file(s) size, where can I get it?
    Since the file upload field allows multiple files I need to sum them up and provide custom validation.

    Definitely there should be such an info, even before real upload, because when file is chosen from a disk, the info about it’s size and type is shown.

    Or is there even some native function for this?

    Thanks
    Petr

Viewing 2 replies - 1 through 2 (of 2 total)
  • anchaal05

    (@anchaal05)

    Hey there,
    Thank you for using Caldera Forms.

    You can use the upload_size_limit filter for this. Add it conditionally if Caldera Forms is submitting. Check for the WordPress query var cf_api

    https://developer.wordpress.org/reference/hooks/upload_size_limit/

    If you need help implementing this, please open a support ticket at http://calderaforms.com/support

    Thread Starter blackeye0013

    (@blackeye0013)

    Hi, thanks for your reply.

    Does this upload_size_limit filter apply to one file or the sum of all uploaded files? I need to limit the SUM of ALL uploaded files together, not just one by one. I’m affraid this is not the case of upload_size_limit filter.

    And what exactly do you mean by “Check for the WordPress query var cf_api”? I’ve tried to google it but haven’t recieved any reasonable answer.

    Thanks again.
    Petr

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How to get uploaded file size?’ is closed to new replies.