Reply To: Direct to S3 File Path
How do I get access to the entry data in the file path array? If I wanted to do the path as “{Job ID:20}/{filename}” how would I pull that from the $entry array?
add_filter( ‘syncs3_put_object_file_path’, ‘customize_syncs3_path’, 10, 6 );
/**
* Custom logic to set the bucket name in SyncS3 for Gravity Forms
*
* @param string $path File path to return. Make sure the path ends with $file_name.
* @param string $file Local file URL when uploaded
* @param string $file_name Name of uploaded file
* @param int $field_id ID of the fileupload field
* @param int $form_id ID of the form
* @param array $entry Entry data
*
* @return string Bucket name
*/
function customize_syncs3_path( $path, $file, $file_name, $field_id, $form_id, $entry ) {
// Custom logic
$path = “testing/new/{$file_name}”; // Make sure the new path includes the file name
return $path;
}