CARVIEW |
Select Language
HTTP/2 200
date: Sun, 12 Oct 2025 00:50:05 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=mnP1bYCETppYDToyHjljIYk9twUxfZpoZ6N0rkBKPQAG8C8Wz5mG6Nd8YI88pnJbst2LVgOlIt7REPk9Adiw9ZrcPyYa3UzbXgQgU%2BIyiUiekphE"}]}
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
content-encoding: gzip
cf-ray: 98d299dbeefaad8b-BLR
gform_file_upload_tmp_dir - Gravity Forms Documentation
gform_file_upload_tmp_dir
Description
The gform_file_upload_tmp_dir
filter allows developers to change the temporary directory used for file uploads.
Usage
Applies to all forms:
add_filter( 'gform_file_upload_tmp_dir', 'your_function_name', 10, 2 );
To target a specific form append the form id to the hook name. (format: gform_file_upload_tmp_dir_FORMID)
add_filter( 'gform_file_upload_tmp_dir_123', 'your_function_name', 10, 2 );
Parameters
- $tmp_upload_locations array
An array containing the path and url of the temporary upload directory. - $form_id int
The ID of the form.
Examples
Change the temporary file upload directory
add_filter( 'gform_file_upload_tmp_dir', function ( $tmp_upload_locations, $form_id ) {
return array(
'path' => '/Users/morgan/Local/gravity-forms/app/public/wp-content/uploads/gravity_forms/' . $form_id . '/tmp/',
'url' => 'https://gravity-forms.local/wp-content/uploads/gravity_forms/' . $form_id . '/tmp/'
);
}, 10, 2 );
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?
Source Code
This filter is located in /form_display.php
Since
The filter was added in Gravity Forms 2.9.3