WordPress.org

Ready to get started?Download WordPress

Forums

Gravity Forms Advanced File Uploader
Upload image into sub-directory depending on gravity form field value (2 posts)

  1. laichejl
    Member
    Posted 7 months ago #

    I'm currently using the advanced file uploader plugin in conjunction with a "media file manager" plugin that creates sub-directories within the uploads folder. Our client wants to separate content in the library this way.

    So, they want functionality on the site where a user can upload straight to the media library, but based on what they choose for a "category" field in the form, the image will upload to the corresponding sub-directory within uploads.

    Is there a simple way to do this? I tried tinkering with some of the plugin core files but couldn't get it to work.

    https://wordpress.org/plugins/gravity-forms-advanced-file-uploader/

  2. ben.moody
    Member
    Plugin Author

    Posted 5 months ago #

    Hi \
    You can use the following filter in your functions.php file to edit the file destination for each upload:

    apply_filter( 'prso_gform_pluploader_wp_upload_dir', $wp_upload_dir );

    $wp_upload_dir should be an array where $wp_upload_dir['path'] is the base directory for the file upload

Reply

You must log in to post.

About this Plugin

About this Topic