I want to modify the uploaded file URL before saving to database when user submits the Gravity form.
I am trying to acheive this by using “gform_save_field_value” filter in Gravity form. But when i print fields inside the filter function i never get the file upload field ID. All other fields are accessable inside filter function except file upload input field.
add_filter( 'gform_save_field_value', 'save_field_value', 10, 4 );
function save_field_value( $value, $lead, $field, $form ) {
print_r($field);
}
The gform_upload_path filter will allow you to change the upload path of the file (and the URL).
If you need to change the actual name of the file, here is a snippet that makes it a cinch.
http://gravitywiz.com/rename-uploaded-files-for-gravity-form/