• Resolved SteveYantz

    (@steveyantz)


    I’m using
    forminator_custom_form_submit_before_set_fields

    most of the data arrives.
    But not file fields.
    I also tried to create a hidden field, and i use jQuery to fill the value with the image file after user selects a file. which does show up as base64 in the html inspection.

    When I inspect the header of the http request after submission, I see that the image field doesn’t contain data, it contains (binary) as the value.
    the hidden field via http header doesn’t contain anything.

    I want control of the image after submission, to save it in a folder, and rename it as (user id)-coach

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @steveyantz

    I hope you’re well today!

    I’m not sure if I correctly understand the goal but if it comes to hidden fields: since a few releases back they are additional sanitized for security reasons. They cannot contain anything else than what is actually set in field’s settings – any other values will be stripped out.

    This is to prevent manipulating hidden fields in cases like e.g. if the field contains some important information that should not be “spoofed” by “clever user” and to avoid injecting unwanted/dangerous code into them.

    If you are using some custom code that did work for you with Forminator and hidden fields in the past, then the simplest way to overcome that would be:

    1. replace the “hidden” field with regular “text” field
    2. hide that field using CSS
    3. and update field ID/code in your custom code to write into that text field instead.

    Text (input) fields are still sanitized but not this way as by design they are meant to allow “free input” so they will carry data over. Note though: you need to hide them with custom CSS – not with visibility condition (because hidden with visibility condition wouldn’t be included in submission).

    Kind regards,
    Adam

    Plugin Support Zafer – WPMU DEV Support

    (@wpmudevsupport15)

    Hi @steveyantz,

    We haven’t heard from you in a while, we will go ahead and mark this thread as resolved. If you have any additional questions or require further help, please let us know!

    Kind regards,
    Zafer

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘no file & hidden field empty – when intercepting the data via functions file’ is closed to new replies.