PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Changing the File Upload Path?

  1. 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!

    Posted 13 years ago on Thursday September 16, 2010 | Permalink
  2. 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.

    Posted 13 years ago on Thursday September 16, 2010 | Permalink