How to display the true location of file uploads

Gravity Forms hides the true location of uploaded files for security purposes. This makes sense. Here's how Gravity Forms explains it:

By default the real location of the uploaded file will be hidden and the download URL will be generated with a security token to prevent guessing or enumeration attacks to discover the location of other files.

But there are times where you want to display the actual URL of the file! So if you find yourself in that position, you can use this filter to disable the secure URL for all forms:

add_filter( 'gform_secure_file_download_location', '__return_false' );

If you want to make the file URLs visible for only one form, you can use this code instead (replacing {form ID} with the form ID…

add_filter( 'gform_secure_file_download_location_{form ID}', '__return_false' );

As with all our code samples, here's how to add the code to your site.