Fabulous Real Estate Photo
Forum Replies Created
- Fabulous Real Estate PhotoCustomer
Forgot to paste the error message in the trash area.
“There has been a critical error on this website. Please check your site admin email inbox for instructions.”
Fabulous Real Estate PhotoCustomerThat is it. Everything works and we can close out this ticket!
Fabulous Real Estate PhotoCustomerThank you so much!
Fabulous Real Estate PhotoCustomerHow 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;
}Fabulous Real Estate PhotoCustomerThen that should be fine. We have enough storage to keep it temporarily on our WP Engine account. Where do I turn that setting on?
Then I should be able to use the other snippet of code to do file paths, correct?
Fabulous Real Estate PhotoCustomerIs there a way to have it so that once the files are on S3 they are removed from local storage?
Fabulous Real Estate PhotoCustomerIdeally we would love to pull a form field into the naming and have something like /{Job ID:20}/{filename}, but we would take /{entryID}/{filename} if we can get that working.