WordPress.org

Ready to get started?Download WordPress

Forums

Custom Upload Dir
Gravity forms? (3 posts)

  1. myhero
    Member
    Posted 1 year ago #

    Hi,

    Is this compatible with Gravity forms?

    http://wordpress.org/plugins/custom-upload-dir/

  2. Hassan
    Member
    Posted 1 year ago #

    Have you tried it?

  3. bernardberry646
    Member
    Posted 10 months ago #

    I use Gravity Forms and you could simply set Gravity Forms to upload to the path you want, and not worry about having to set anything with this plugin 'to work with' another plugin.. if that makes sense to you. The point is to not try and make another plugin work with or rely on another = limits your probs should ONE of them not work / gets updated / you uninstall one / etc.

    So you could simply use:

    <?php
    add_filter("gform_upload_path", "change_upload_path", 10, 2);
    function change_upload_path($path_info, $form_id){
       $path_info["path"] = "/home/public_html/yourdomainfolder/new/path/";
       $path_info["url"] = "http://yourdomainhere.com/new/path/";
       return $path_info;
    }
    ?>

    The above is called a filter, you put that in your theme's function.php

    Also, at minimum security I would drop a blank index.html file in that folder also. There are a number of other ways to more soundly protect someone from directly listing the folder, the blank index is ONLY if someone tries the folder without calling on a file/page.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.