PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Image upload via file upload -or- URL

  1. I'm creating a form that allows my users to upload a file destined for a post custom field. They can send me the file via a file upload field or via URL. The file uploader works great: I end up with a GF entry that has the little image icon thingy and I get the file's URL in my post custom field. Nice.

    My question comes during the URL upload process. I'm able to use gform_pre_render and cURL to grab a file from any URL and save it wherever I want. But what I really want to do is hook into GF's upload process. I see that during a normal file upload, GF creates a temp file and saves it in a temp directory. Once the form is submitted, the file is copied from the temp directory into its final destination; the post's custom field is set accordingly; and the GF entry has that cute icon.

    My question: If I can grab the file from a URL during gform_pre_render, can I somehow hook into the GF process for saving the file and doing all the other stuff that GF normally does during a file upload?

    Hope this is clear....


    Posted 11 years ago on Thursday September 6, 2012 | Permalink