Looks like I was using this class to do this:
http://gravitywiz.com/rename-uploaded-files-for-gravity-form/
and added the filter in myself after line 207, ie.
// replace merge tags
$form = GFAPI::get_form( $entry['form_id'] );
$value = GFCommon::replace_variables( $value, $form, $entry, false, true, false, 'text' );
// MOD: add a filter here to hook into filename change
$value = apply_filters('gravity_forms_upload_filename', $value, $entry);
$value
will then contain the full path to then uploaded file which can be hooked into and zipped so you can return the zip path instead.
Here is the snippet I was using to load GW_Rename_Uploaded_Files
:
add_action('init', 'my_forms_rename_uploads', 11);
if (!function_exists('my_forms_rename_uploads')) {
function my_forms_rename_uploads() {
if (!class_exists('GW_Rename_Uploaded_Files')) {return;}
$form_ids = array(
1, // list of form IDs to load renaming class for
);
// --- get all file upload fields ---
foreach ($form_ids as $form_id) {
$upload_field_ids = array();
$form = GFFormsModel::get_form_meta($form_id);
if (isset($form['fields'])) {
// --- get upload field IDs ---
foreach ($form['fields'] as $field) {
if ($field->type == 'fileupload') {$upload_field_ids[] = $field->id;}
}
// --- set class arguments ---
$args = array(
'form_id' => $form_id,
'field_id' => $upload_field_ids,
'template' => '{filename}'
);
// --- initialize rename uploaded files class for fields ---
new GW_Rename_Uploaded_Files($args);
}
}
}
}
Hope that helps…