View Categories

Gravity Forms Files Addon

2 min read

We’ve developed an addon that seamlessly integrates the Gravity Forms plugin with Infinite Uploads, providing full compatibility for file handling and storage. This addon ensures that any files uploaded through Gravity Forms are automatically processed and stored using Infinite Uploads’ cloud-based infrastructure. It offers secure file management while maintaining accessibility based on user permissions, enhancing both performance and scalability.

Overview #

The Infinite Uploads Gravity Forms Support addon bridges the gap between Gravity Forms and Infinite Uploads, optimizing how files are stored and retrieved. By leveraging two key Gravity Forms hooks—gform_entry_field_value and gform_secure_file_download_url—this addon redirects file storage from the local server to Infinite Uploads’ cloud system, ensuring efficient resource use and secure access to uploaded files.

Key Features and Technical Details #

  1. Displaying File Paths in Entry Details
    The addon uses the gform_entry_field_value hook to modify how file upload field values are displayed on the Gravity Forms entry details page. When a form with file uploads is submitted, this hook intercepts the file data and adjusts the file paths to point to Infinite Uploads’ remote storage URLs.
    • If multiple files are uploaded, the addon decodes the JSON data, extracts each file’s URL, and presents them as clickable links in an unordered list.
    • For single-file uploads, it directly rewrites the local path to the corresponding Infinite Uploads URL.
      This ensures that all file references in form entries link to the cloud storage location, reducing local server load and improving accessibility.
  2. Serving Files from the Entries List
    The gform_secure_file_download_url hook is employed to adjust file URLs on the Gravity Forms entries list page. When a user attempts to view or download a file from the list, this hook dynamically replaces the default local server path with the Infinite Uploads cloud storage URL.
    • It parses the URL, retrieves the form ID and filename, and constructs the full Infinite Uploads path using the plugin’s upload root information.
    • This redirection ensures that files are served directly from Infinite Uploads’ secure and scalable infrastructure rather than the local server.

Submit a Comment

Your email address will not be published. Required fields are marked *