CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 01:05:39 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
vary: Accept-Encoding
strict-transport-security: max-age=604800
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
referrer-policy: no-referrer
referrer-policy: strict-origin-when-cross-origin
link: ; rel="https://api.w.org/"
link: ; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
fastcgi-cache: HIT
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=Z6RTQ3JFC3tQYQJiN2S%2BwwM4JuKUkHdm1xjol7z%2BZgG6A4fYBj1RYfjlqxjjf%2BPFTtIwRG7NBYg6Bo3Pv3HbYvB2pPa%2F1oX7xry9Vz1vJ9BZ1WRG"}]}
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
content-encoding: gzip
cf-ray: 98d2b0a89a66c1d2-BLR
gform_cleanup_target_dir - Gravity Forms Documentation
gform_cleanup_target_dir
Description
The gform_cleanup_target_dir
filter is used to bypass functionality that relies on open_dir()
, enabling support for the multi-file upload field on servers that don’t support open_dir()
, such as WordPress VIP.
Usage
The filter which runs for all multi-file enabled file uploads would be used like so:
add_filter( 'gform_cleanup_target_dir', 'your_function_name' );
Parameters
- $cleanup_target_dir boolean
Indicates if old temporary files should be removed from the forms tmp directory. Default:true
.
Example
add_filter( 'gform_cleanup_target_dir', '__return_false' );
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Since
This filter was added in Gravity Forms v2.6.4.
Source Code
This filter is located in GFAsyncUpload::upload() in includes/upload.php.