Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I realize this isn't a problem with the module, but rather a lack of skill. I have a webform which has a file upload component. I would like to check if the file specified has already been uploaded and give the user a 'duplicate filename' error message if the file was previously uploaded. I have tried using both hook_form_alter and the Webform Validation module, but I can't find where I can capture the file component value prior to submitting the form. Any help would be greatly appreciated.
Comments
Comment #1
Liam MorlandYou make your own custom validation rule and do whatever checks you want.
Comment #2
keschl CreditAttribution: keschl commentedThe problem is I haven't been able to capture the filename which is being uploaded. I believe it is stored in $formstate['webform']['component_tree']['children']['1'][value].
Comment #2.0
keschl CreditAttribution: keschl commentedcorrected grammar
Comment #3
Liam MorlandDrupal 6 is no longer supported. If this issue exists in a later version of webform_validation, please re-open and update the version number.