Home › Forums › General Issues › Cant upload an image from a Gravity Form to an ACF image field › Reply To: Cant upload an image from a Gravity Form to an ACF image field
Yes, all that is needed is to hook into the GF save, and modify the value before it is saved to the DB.
The quest is, ‘does GF insert the image data into the DB (like WP), or does it only save the file and provide a URL to see it’?
If GF does not save the DB data, then ACF can’t load the attachment. You could easily write some code which uses the url value to get a path to the image. Use this path to then insert the image into the db through some of WP’s built in image functions (google how to write a custom file uploader in WP)
Then, once you have the data inserted and an attachment ID, return this to GF for it to save, and then ACF will read it!
Hope that helps.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We’re reaching out to our multilingual users to ask for help in translating ACF 6.1. Help make sure the latest features are available in your language here: https://t.co/TkEc2Exd6U— Advanced Custom Fields (@wp_acf) May 22, 2023
© 2023 Advanced Custom Fields.