Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom directory is not working for File Upload field #7393

Open
orzut opened this issue Jan 28, 2025 · 0 comments
Open

Custom directory is not working for File Upload field #7393

orzut opened this issue Jan 28, 2025 · 0 comments

Comments

@orzut
Copy link

orzut commented Jan 28, 2025

Description

I’m using Advanced Custom Type Pods, and I configured my file upload field to upload the files to custom directory. But the uploading files are still going to wp-content/uploads/yyyy/mm folder.

Version

3.2.8.1

Testing Instructions

  1. Create Advanced Custom Type Pod
  2. Add File/Image/Video field
  3. On the Field settings click on the File/Image/Video Options
  4. Settings to choose:
    • Upload Limit -> Single File
    • File Uploader -> Upload Only (Plupload)
    • Restrict File Types -> Any Type
    • Upload Directory -> Custom directory within the default uploads directory
    • Custom Upload Directory -> my-folder/another-folder/{@ID} (I made sure to create my-folder/another-folder directory within wp-content/uploads/
  5. Upload the file via front end form (Gravity Forms configured with Pods).
  6. Uploaded file goes to wp-content/uploads/yyyy/mm folder.

Screenshots / Screencast

No response

Possible Workaround

No response

Site Health Information

`
### wp-core ###

version: 6.6.2
site_language: en_US
user_language: en_US
timezone: +00:00
permalink: /%id%
https_status: true
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: open
environment_type: production
user_count: 17
dotorg_communication: true

### wp-paths-sizes ###

wordpress_path: /web/pagely/orcid/docroot
wordpress_size: 4.69 GB (5036201172 bytes)
uploads_path: /web/pagely/orcid/docroot/wp-content/uploads
uploads_size: 40.87 MB (42856765 bytes)
themes_path: /web/pagely/orcid/docroot/wp-content/themes
themes_size: 84.93 MB (89053398 bytes)
plugins_path: /web/pagely/orcid/docroot/wp-content/plugins
plugins_size: 75.73 MB (79409759 bytes)
fonts_path: /web/pagely/orcid/docroot/wp-content/uploads/fonts
fonts_size: directory not found
database_size: 24.14 MB (25313280 bytes)
total_size: 4.91 GB (5272834374 bytes)

### wp-active-theme ###

name: Divi (Divi)
version: 4.27.1 (latest version: 4.27.4)
author: Elegant Themes
author_website: http://www.elegantthemes.com
parent_theme: none
theme_features: core-block-patterns, widgets-block-editor, block-templates, custom-background, automatic-feed-links, post-thumbnails, menus, title-tag, post-formats, woocommerce, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, customize-selective-refresh-widgets, wp-block-styles, editor-style, widgets
theme_path: /web/pagely/orcid/docroot/wp-content/themes/Divi
auto_update: Disabled

### wp-themes-inactive (8) ###

Northwestern (Global): version: 1.3.06.1, author: Northwestern IT S&S Media and Design, Auto-updates disabled
Twenty Fifteen: version: 2.0, author: the WordPress team (latest version: 3.9), Auto-updates disabled
Twenty Seventeen: version: 1.7, author: the WordPress team (latest version: 3.8), Auto-updates disabled
Twenty Sixteen: version: 1.5, author: the WordPress team (latest version: 3.4), Auto-updates disabled
Twenty Twenty-Four: version: 1.2, author: the WordPress team (latest version: 1.3), Auto-updates disabled
Twenty Twenty-One: version: 1.8, author: the WordPress team (latest version: 2.4), Auto-updates disabled
Twenty Twenty-Three: version: 1.1, author: the WordPress team (latest version: 1.6), Auto-updates disabled
Twenty Twenty-Two: version: 1.4, author: the WordPress team (latest version: 1.9), Auto-updates disabled

### wp-plugins-active (17) ###

CITI Training: version: 1.0.0, author: Orzu Tursunova, Auto-updates disabled
Font Awesome: version: 4.5.0, author: Font Awesome, Auto-updates disabled
Frontend Reset Password: version: 1.2.2, author: WP Enhanced, Auto-updates disabled
Gravity Forms: version: 2.9.2, author: Gravity Forms, Auto-updates enabled
Gravity Forms Mailgun Add-On: version: 1.4.0, author: Gravity Forms, Auto-updates disabled
Gravity Forms User Registration Add-On: version: 5.3.1, author: Gravity Forms, Auto-updates disabled
Gravity SMTP: version: 1.6.1, author: Gravity Forms, Auto-updates disabled
Members: version: 3.2.17, author: MemberPress, Auto-updates disabled
MTI Globus Manager: version: 1.0.0, author: Northwestern University Information Technologies - Media & Technology Innovation (MTI), Auto-updates disabled
OAuth Single Sign On - SSO (OAuth Client): version: 6.26.1, author: miniOrange (latest version: 6.26.4), Auto-updates disabled
OpenID Connect Generic: version: 3.10.0, author: daggerhart, Auto-updates disabled
Pods - Custom Content Types and Fields: version: 3.2.8.1, author: Pods Framework Team, Auto-updates disabled
Pods Gravity Forms Add-On: version: 1.5.0, author: Pods Framework Team, Auto-updates disabled
Prevent Direct Access: version: 2.8.7, author: BWPS, Auto-updates disabled
Secure DUA (Data Use Agreement) Files: version: 1.0.0, author: Orzu Tursunova, Auto-updates disabled
Table Sorter: version: 2.3, author: Farhan Noor, Auto-updates disabled
WP Crontrol: version: 1.18.0, author: John Blackbourn, Auto-updates disabled

### wp-plugins-inactive (8) ###

Advanced Custom Fields: version: 5.12.3, author: Delicious Brains (latest version: 6.3.12), Auto-updates disabled
Classic Editor: version: 1.6.2, author: WordPress Contributors (latest version: 1.6.7), Auto-updates disabled
Divi Builder: version: 1.3, author: Elegant Themes (latest version: 4.27.4), Auto-updates disabled
Formidable Forms: version: 6.16.2, author: Strategy11 Form Builder Team (latest version: 6.17.1), Auto-updates disabled
GA Google Analytics: version: 20220517, author: Jeff Starr (latest version: 20241102), Auto-updates disabled
Hello Dolly: version: 1.7.2, author: Matt Mullenweg, Auto-updates disabled
Page Restriction WordPress (WP) - Protect WP Pages/Post: version: 1.3.6, author: miniOrange (latest version: 1.3.7), Auto-updates disabled
Remove Dashboard Access: version: 1.1.5, author: TrustedLogin (latest version: 1.2.1), Auto-updates disabled

### wp-media ###

image_editor: WP_Image_Editor_GD
imagick_module_version: Not available
imagemagick_version: Not available
imagick_version: Not available
file_uploads: 1
post_max_size: 256M
upload_max_filesize: 256M
max_effective_size: 256 MB
max_file_uploads: 20
gd_version: 2.3.3
gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM
ghostscript_version: 9.55.0

### wp-server ###

server_architecture: Linux 6.8.0-1021-aws x86_64
httpd_software: Apache/2.4.52 (Ubuntu)
php_version: 7.4.33 64bit
php_sapi: apache2handler
max_input_variables: 1000
time_limit: 30
memory_limit: 2048M
max_input_time: 60
upload_max_filesize: 256M
php_post_max_size: 256M
curl_version: 7.81.0 OpenSSL/3.0.2
suhosin: false
imagick_availability: false
pretty_permalinks: true
htaccess_extra_rules: true
current: 2025-01-28T18:16:56+00:00
utc-time: Tuesday, 28-Jan-25 18:16:56 UTC
server-time: 2025-01-28T18:16:56+00:00

### wp-database ###

extension: mysqli
server_version: 8.0.40-0ubuntu0.22.04.1
client_version: mysqlnd 7.4.33
max_allowed_packet: 67108864
max_connections: 151

### wp-constants ###

WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /web/pagely/orcid/docroot/wp-content
WP_PLUGIN_DIR: /web/pagely/orcid/docroot/wp-content/plugins
WP_MEMORY_LIMIT: 40M
WP_MAX_MEMORY_LIMIT: 2048M
WP_DEBUG: true
WP_DEBUG_DISPLAY: true
WP_DEBUG_LOG: false
SCRIPT_DEBUG: false
WP_CACHE: false
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: Undefined
WP_DEVELOPMENT_MODE: undefined
DB_CHARSET: utf8mb4
DB_COLLATE: undefined

### wp-filesystem ###

wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
fonts: not writable

### pods ###

pods-version: 3.2.8.1
pods-first-version: 3.2.2
pods-last-version: 3.2.6
pods-server-software: Apache/2.4.52 (Ubuntu)
pods-user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:134.0) Gecko/20100101 Firefox/134.0
pods-session-save-path: /var/lib/php/sessions
pods-session-save-path-exists: Yes
pods-session-save-path-writable: Yes
pods-session-max-lifetime: 1440
pods-opcode-cache-apc: No
pods-opcode-cache-memcached: No
pods-opcode-cache-opcache: Yes
pods-opcode-cache-redis: No
pods-object-cache-apc: No
pods-object-cache-apcu: Yes
pods-object-cache-memcache: Yes
pods-object-cache-memcached: Yes
pods-object-cache-redis: No
pods-memory-current-usage: 16.132M / 40M
pods-memory-current-usage-real: 8.000M
pods-network-wide: No
pods-install-location: /wp-content/plugins/pods/
pods-developer: No
pods-tableless-mode: No
pods-relationship-table-enabled: Yes
pods-relationship-table-status: 28
pods-light-mode: No
pods-strict: No
pods-allow-deprecated: Yes
pods-api-cache: Yes
pods-shortcode-allow-evaluate-tags: No
pods-can-use-sessions: Yes
pods-settings-types_only: Enable [types_only=0]
pods-settings-watch_changed_fields: Disable [watch_changed_fields=0]
pods-settings-metadata_integration: Disable [metadata_integration=0]
pods-settings-metadata_override_get: Disable [metadata_override_get=0]
pods-settings-register_meta_integration: Disable [register_meta_integration=0]
pods-settings-media_modal_fields: Enable [media_modal_fields=0]
pods-settings-session_auto_start: Disable [session_auto_start=0]
pods-settings-dynamic_features_allow: Enable [dynamic_features_allow=1]
pods-settings-dynamic_features_enabled: Display and Form [dynamic_features_enabled=display,form]
pods-settings-show_access_restricted_messages: Disable [show_access_restricted_messages=0]
pods-settings-show_access_admin_notices: Enable [show_access_admin_notices=1]
pods-settings-dynamic_features_allow_sql_clauses: Disable [dynamic_features_allow_sql_clauses=0]
pods-settings-display_callbacks: Customized [display_callbacks=customized]
pods-settings-display_callbacks_allowed: esc_attr,esc_html

`

Pods Package

{
    "@meta": {
        "version": "3.2.8.1",
        "build": 1738088296
    },
    "settings": {
        "types_only": "0",
        "watch_changed_fields": "0",
        "metadata_integration": "0",
        "metadata_override_get": "0",
        "register_meta_integration": "0",
        "media_modal_fields": "0",
        "session_auto_start": "0",
        "dynamic_features_allow": "1",
        "dynamic_features_enabled": [
            "display",
            "form"
        ],
        "show_access_restricted_messages": "0",
        "show_access_admin_notices": "1",
        "dynamic_features_allow_sql_clauses": "0",
        "display_callbacks": "customized",
        "display_callbacks_allowed": "esc_attr,esc_html",
        "wisdom_opt_out": "1",
        "active_components": [
            "advanced-content-types",
            "migrate-packages",
            "pages",
            "roles-and-capabilities",
            "templates"
        ]
    },
    "pods": [
        {
            "name": "institution",
            "id": 108,
            "label": "institutions",
            "description": "",
            "type": "pod",
            "storage": "table",
            "label_singular": "institution",
            "public": "1",
            "show_ui": "1",
            "pod_index": "institution_name",
            "_migrated_28": "1",
            "dynamic_features_allow": "inherit",
            "restrict_dynamic_features": "1",
            "restricted_dynamic_features": [
                "form",
                "display"
            ],
            "restricted_dynamic_features_forms": [
                "edit",
                "add"
            ],
            "show_access_restricted_messages": "inherit",
            "show_access_admin_notices": "inherit",
            "hierarchical": "0",
            "pod_parent": "parent",
            "detail_url": "institutions\/{@id}\/",
            "groups": [
                {
                    "name": "details",
                    "id": 109,
                    "label": "Details",
                    "description": "",
                    "weight": 0,
                    "fields": [
                        {
                            "name": "institution_name",
                            "id": 110,
                            "label": "Institution Name",
                            "description": "",
                            "weight": 0,
                            "type": "text",
                            "required": "1",
                            "text_allowed_html_tags": "strong em a ul ol li b i",
                            "text_max_length": "255",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "default_evaluate_tags": "0",
                            "default_empty_fields": "0",
                            "roles_allowed": "administrator",
                            "enable_conditional_logic": "0",
                            "unique": "0",
                            "text_trim": "1",
                            "text_trim_lines": "1",
                            "text_trim_p_brs": "0",
                            "text_trim_extra_lines": "0",
                            "text_allow_html": "0",
                            "text_sanitize_html": "1",
                            "text_allow_shortcode": "0",
                            "logged_in_only": "0",
                            "admin_only": "0",
                            "restrict_role": "0",
                            "restrict_capability": "0",
                            "hidden": "0",
                            "read_only": "0"
                        },
                        {
                            "name": "office_name",
                            "id": 115,
                            "label": "Office Name",
                            "description": "",
                            "weight": 1,
                            "type": "text",
                            "text_allowed_html_tags": "strong em a ul ol li b i",
                            "text_max_length": "255",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "default_evaluate_tags": "0",
                            "default_empty_fields": "0",
                            "roles_allowed": "administrator",
                            "enable_conditional_logic": "0",
                            "required": "1",
                            "unique": "0"
                        },
                        {
                            "name": "email",
                            "id": 116,
                            "label": "Email",
                            "description": "",
                            "weight": 2,
                            "type": "email",
                            "email_max_length": "255",
                            "email_html5": "0",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "default_evaluate_tags": "0",
                            "default_empty_fields": "0",
                            "roles_allowed": "administrator",
                            "enable_conditional_logic": "0",
                            "required": "1",
                            "unique": "0"
                        },
                        {
                            "name": "phone",
                            "id": 117,
                            "label": "Phone",
                            "description": "",
                            "weight": 3,
                            "type": "phone",
                            "phone_format": "999-999-9999 x999",
                            "phone_max_length": "25",
                            "phone_html5": "0",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "default_evaluate_tags": "0",
                            "default_empty_fields": "0",
                            "roles_allowed": "administrator",
                            "enable_conditional_logic": "0",
                            "required": "1",
                            "unique": "0"
                        },
                        {
                            "name": "dua",
                            "id": 118,
                            "label": "Signed Institutional Data Use Agreement",
                            "description": "",
                            "weight": 4,
                            "type": "file",
                            "file_format_type": "single",
                            "file_uploader": "plupload",
                            "file_type": "any",
                            "file_attachment_tab": "upload",
                            "file_upload_dir": "uploads",
                            "file_edit_title": "1",
                            "file_show_edit_link": "0",
                            "file_linked": "1",
                            "file_limit": "0",
                            "file_field_template": "rows",
                            "file_add_button": "Add File",
                            "file_modal_title": "Attach a file",
                            "file_modal_add_button": "Add File",
                            "file_wp_gallery_link": "file",
                            "file_wp_gallery_columns": "3",
                            "file_wp_gallery_size": "thumbnail",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "default_evaluate_tags": "0",
                            "default_empty_fields": "0",
                            "roles_allowed": "administrator",
                            "enable_conditional_logic": "0",
                            "required": "0",
                            "unique": "0",
                            "file_attachment_current_post_only": "0",
                            "file_auto_set_featured_image": "0",
                            "file_upload_dir_custom": "DUA\/signed\/{@ID}",
                            "logged_in_only": "0",
                            "admin_only": "0",
                            "restrict_role": "0",
                            "restrict_capability": "0",
                            "hidden": "0",
                            "read_only": "0"
                        },
                        {
                            "name": "created",
                            "id": 111,
                            "label": "Date Created",
                            "description": "",
                            "weight": 5,
                            "type": "datetime",
                            "datetime_format": "ymd_slash",
                            "datetime_time_type": "12",
                            "datetime_time_format": "h_mm_ss_A"
                        },
                        {
                            "name": "modified",
                            "id": 112,
                            "label": "Date Modified",
                            "description": "",
                            "weight": 6,
                            "type": "datetime",
                            "datetime_format": "ymd_slash",
                            "datetime_time_type": "12",
                            "datetime_time_format": "h_mm_ss_A"
                        },
                        {
                            "name": "permalink",
                            "id": 114,
                            "label": "Permalink",
                            "description": "",
                            "weight": 7,
                            "type": "slug",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "default_evaluate_tags": "0",
                            "default_empty_fields": "0",
                            "roles_allowed": "administrator",
                            "enable_conditional_logic": "0",
                            "required": "0",
                            "unique": "0",
                            "logged_in_only": "0",
                            "admin_only": "0",
                            "restrict_role": "0",
                            "restrict_capability": "0",
                            "hidden": "0",
                            "read_only": "0"
                        },
                        {
                            "name": "application_status",
                            "id": 119,
                            "label": "Application Status",
                            "description": "",
                            "weight": 8,
                            "type": "pick",
                            "pick_object": "custom-simple",
                            "pick_format_type": "single",
                            "pick_format_single": "dropdown",
                            "pick_format_multi": "list",
                            "pick_display_format_multi": "default",
                            "pick_display_format_separator": ", ",
                            "pick_allow_add_new": "1",
                            "pick_taggable": "0",
                            "pick_show_icon": "1",
                            "pick_show_edit_link": "1",
                            "pick_show_view_link": "1",
                            "pick_limit": "0",
                            "pick_user_role": "Administrator",
                            "pick_post_status": "publish",
                            "pick_post_author": "0",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "default_evaluate_tags": "0",
                            "default_empty_fields": "0",
                            "roles_allowed": "administrator",
                            "enable_conditional_logic": "0",
                            "pick_custom": "APPROVED\nPENDING\nREJECTED\nRESUBMIT",
                            "required": "0",
                            "unique": "0",
                            "logged_in_only": "0",
                            "admin_only": "0",
                            "restrict_role": "0",
                            "restrict_capability": "0",
                            "hidden": "0",
                            "read_only": "0"
                        },
                        {
                            "name": "name",
                            "id": 132,
                            "label": "Name",
                            "description": "",
                            "weight": 9,
                            "type": "text",
                            "text_allowed_html_tags": "strong em a ul ol li b i",
                            "text_max_length": "255",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "default_evaluate_tags": "0",
                            "default_empty_fields": "0",
                            "roles_allowed": "administrator",
                            "enable_conditional_logic": "0",
                            "required": "0",
                            "unique": "0"
                        },
                        {
                            "name": "first_name_admin",
                            "id": 221,
                            "label": "First Name Admin",
                            "description": "",
                            "weight": 10,
                            "type": "text",
                            "text_allowed_html_tags": "strong em a ul ol li b i",
                            "text_max_length": "255",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "default_evaluate_tags": "0",
                            "default_empty_fields": "0",
                            "roles_allowed": "administrator",
                            "enable_conditional_logic": "0",
                            "required": "0",
                            "unique": "0"
                        },
                        {
                            "name": "last_name_admin",
                            "id": 222,
                            "label": "Last Name Admin",
                            "description": "",
                            "weight": 11,
                            "type": "text",
                            "text_allowed_html_tags": "strong em a ul ol li b i",
                            "text_max_length": "255",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "default_evaluate_tags": "0",
                            "default_empty_fields": "0",
                            "roles_allowed": "administrator",
                            "enable_conditional_logic": "0",
                            "required": "0",
                            "unique": "0"
                        },
                        {
                            "name": "email_admin",
                            "id": 223,
                            "label": "Email Admin",
                            "description": "",
                            "weight": 12,
                            "type": "email",
                            "email_max_length": "255",
                            "email_html5": "0",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "default_evaluate_tags": "0",
                            "default_empty_fields": "0",
                            "roles_allowed": "administrator",
                            "enable_conditional_logic": "0",
                            "required": "0",
                            "unique": "0"
                        },
                        {
                            "name": "requests",
                            "id": 985,
                            "label": "Requests",
                            "description": "",
                            "weight": 13,
                            "type": "pick",
                            "pick_object": "pod",
                            "pick_val": "dataset_request",
                            "pick_format_type": "single",
                            "pick_format_single": "dropdown",
                            "pick_format_multi": "list",
                            "pick_display_format_multi": "default",
                            "pick_display_format_separator": ", ",
                            "pick_allow_add_new": "1",
                            "pick_taggable": "0",
                            "pick_show_icon": "1",
                            "pick_show_edit_link": "1",
                            "pick_show_view_link": "1",
                            "pick_limit": "0",
                            "pick_user_role": "Administrator",
                            "pick_post_status": "publish",
                            "pick_post_author": "0",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "default_evaluate_tags": "0",
                            "default_empty_fields": "0",
                            "roles_allowed": "administrator",
                            "enable_conditional_logic": "0",
                            "required": "0",
                            "unique": "0",
                            "sister_id": "984"
                        },
                        {
                            "name": "submitted_by",
                            "id": 1314,
                            "label": "Submitted By",
                            "description": "",
                            "weight": 14,
                            "type": "text",
                            "text_allowed_html_tags": "strong em a ul ol li b i",
                            "text_max_length": "255",
                            "repeatable": "0",
                            "repeatable_format": "default",
                            "default_evaluate_tags": "0",
                            "default_empty_fields": "0",
                            "roles_allowed": "administrator",
                            "enable_conditional_logic": "0",
                            "required": "0",
                            "unique": "0"
                        }
                    ]
                }
            ]
        }
    ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant