CS Forms - Save URL in Field (file inputs bugs/feature requests)

Hello,

Its great to see that some updates have been rolled out for Cornerstone Forms regarding the file upload inputs however i’m still experiencing a few problems.

  1. When enabling the Save URL in Field on a regular file input it add’s the field name to the data table but it doesn’t add the url to the field value. However i’m able to upload the file as an attachment in the email action with the form data type.
  2. When enabling the Save URL in Field on a drop-in zone input it doesnt even add the input field name to the data table and neither the field value as described in point 1.

In both cases i’m also not even able to print the field value in either a succes message, regular text element or email action. Nor is the file visible in my media library.

Is this something you guys could look at for me?

Also i have some requests:

  1. It would be great if I could add my own validation on file and drop-in inputs like the required validation to add my own error message. I had it set up as a custom error message with the condition “file exists”. That triggers an error but doesn’t prevent the form from being submitted with incomplete information.
  2. Same goes for things like file upload size validation.
  3. It would also be nice if we could add conditions on the email attachments. (e.g. add attachement if file exists)

For context, the reason why i’m asking all this is because i’ve been struggling with the files for a job vacancy form.

  • I want a drop-in zone for the resume that is required.
  • I would prefer to have the resume uploaded to the server directly instead of the media library to prevent it from being easily publicly accessible.
  • The resume needs to be send as an attachment in the email notification
  • The form submission data table needs to have a link to file (preferably working with a server upload but understandable if it’s only possible with a media library upload)
  • The file upload is restricted to only 1 file

And then I also have the same requirements for the portfolio file input, however this input needs to be optional.

And in the end I ofcourse only want to create one email action regardless of if a form gets submitted with or without a portfolio.

Am I missing something? Surely this isn’t a unique case that cornerstone forms wasn’t build for (yet)

Thanks in advance everybody.

Hey @100leiden,

1. Why “Save URL in Field” is not saving or displaying the URL

  • Regular File Input:
    When you enable Save URL in Field, the file is correctly uploaded to the WordPress Media Library, and the plugin sets a temporary override value containing the URL. However, the system has two issues:
    1. Overwritten/Cleared Context: At the very end of the form rendering lifecycle, the plugin calls cs_form_remove_context(), which clears all input overrides. By the time success messages, text elements, or email actions attempt to resolve the dynamic content, the override has already been wiped out.
    2. Dynamic Content Limitation: The dynamic content tag {{dc:form:data key="field_name"}} reads directly from the $_REQUEST global array. Because file uploads reside in $_FILES (and the saved URL override is wiped out), it finds nothing and remains empty.
  • Drop-in Zone Input:
    The Drop-in zone uses dropzone_paramName instead of name to store its field identifier. During the form registration and rendering phase, the plugin scans elements for the name attribute to register inputs. Because it does not find a name attribute on the Drop-in zone, the input is never registered in the form’s data table structure.

2. Why Custom Error Actions (e.g., “file exists” condition) do not prevent form submission / database actions

Form actions (like Post Insert, Email Action, and your Custom Error Action) are executed sequentially during the form’s rendering phase.

  • If your Email Action or Post Insert action is positioned above the Custom Error Action in the builder list, the emails are sent and entries are created before the Custom Error Action is even reached and throws its error.
  • Solution: Instead of using a conditional Action for validation, you should use the built-in validators directly on the input elements (such as required or setting maximum file size limits). These run during the validation phase prior to any action execution, successfully blocking the submission and preventing actions from running if requirements are not met.

3. Attaching Optional files to Emails without conditional logic

In the Email Action settings under Attachments:

  • When you add a new attachment with the type Form Data and target a field name (e.g. portfolio), the email action is designed to check if a file was actually uploaded.
  • If the user submits the form without selecting a file for the optional portfolio field, the plugin naturally skips it and does not attach anything. You do not need custom conditional actions to toggle the attachment.
  • Note on Dropzone files: Because the Drop-in zone/Dropzone uploads files as arrays ($_FILES['field_name']['tmp_name'] is an array of paths), selecting a Dropzone field as a Form Data attachment in the Email Action currently triggers PHP errors under the hood because the mailer expects a single string path rather than an array of paths.

Summary of what you can do next

  1. Required vs Optional validations: Set the Required toggle directly on your Resume file input/Dropzone. This ensures validation happens on the validation layer and prevents action processing if missing.
  2. Local Server Uploads: In the File Upload Action, you can turn off Create Media (which disables Media Library registration) and specify a custom Upload Path on your server. This uploads files directly to a directory of your choice.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.