I would like to change the path for files uploaded via Gravity Forms. I've seen the example filters in the change_log, but I don't know how to use them. Any advice would be appreciated. Thanks!
I would like to change the path for files uploaded via Gravity Forms. I've seen the example filters in the change_log, but I don't know how to use them. Any advice would be appreciated. Thanks!
You would add this to your theme's functions.php file:
<?php
add_filter("gform_upload_path", "change_upload_path", 20, 2);
function change_upload_path($path_info, $form_id){
$path_info["path"] = "/new/path/";
$path_info["url"] = "http://new_url.com/images/";
return $path_info;
}
?>
You would swap out the path_info["path"] above with the full server path to where you want the files, and it has to exist and have the correct file permissions. You would have to know what this full path is.
You would then swap out the path_info["url"] with the http:// path to that folder so it knows how to call the images.
The code snippet it above would change the upload path for all your forms.