Forminator file upload

When uploading an Image through Forminator the file upload is not showing in the media library. Will the uploaded image Smush automatically?

  • Dimitris
    • Support Star

    Hello there Tony G

    Hope you're doing good today! :slight_smile:

    It's true that images uploaded from the File Upload field aren't added to Media Library, so Smush can't automatically optimize them.

    There's been a feature request about adding a new option for admins, so they can control if uploaded images should go to the Media library, which should resolve the auto-Smush issue.

    I've already commented to our internal feature-request task about this, if there's any development on this, we'll keep you posted here.

    Thank you,
    Dimitris

    • Tony G
      • Mr. LetsFixTheWorld

      Thanks Dimitris - until an enhancement is implemented, what would be a suggested manual work-around? I'm thinking:

      1) Change the folder that receives uploads to something like /uploads/forminator/files.
      Write a script that gets executed via cron or which is hooked to forminator:
      2) Move files from /files to to_smush. Save a list of the file names.
      3) Use the WP CLI to smush everything in to_smush.
      4) Move all to_smush files to the current /uploads/year/month folder, using the WP CLI to ensure the files are imported into the media library. We might be able to skip step #3 if Smush detects files added to the media library.
      5) The Forminator Entry objects are pointing to the originals in /files. Modify those records to point to a new folder: /uploads/forminator/saved.

      I can do all of that, though it will take a while to research each step.
      It will be a hassle to get the right Entry objects to modify in #5.
      It might be easier not to move the files from the original folder where Forminator places them. Then when a new file is uploaded, check media files to see if there is already a file with a given name before copying and smushing it.

      That makes me wonder what Forminator does if two people submit files that have the same name, like abc.jpg or january.pdf.

      I don't suppose anyone has already done this? :crying_cat_face:

  • Prathamesh Palve
    • Staff

    Hello Tony G,

    I checked with the Developers and we see no quick workaround for this at the moment. I am afraid we will have to wait until the release. I see the work for this feature is already ON and estimate it to roll out soon. Though I would not be able to give you an ETA of the feature release, you can keep a check on the roadmap here: https://premium.wpmudev.org/roadmap/ and also keep a check on the plugin updates.

    Thanks,
    Prathamesh

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.