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.

File Upload - Add to "Media Library"

  1. Anonymous
    Unregistered

    I have a form where logged in users upload 10 images for a "sample" gallery on our website. How can I have it so that each of the 10 file uploads are automatically added to the "Media Library" in wordpress so I can easily create the gallery as an admin. Otherwise I have to download the images and then re-upload them into the "Media Library".

    Thanks

    Bryan

    Posted 11 years ago on Tuesday April 2, 2013 | Permalink
  2. If your visitors are uploading files, they are not added to the image gallery by default. Only post images will be moved to the media gallery. You can use the wp_insert_attachment function to take the uploaded images and move them to the media gallery:
    http://codex.wordpress.org/Function_Reference/wp_insert_attachment

    You could use the gform_after_submission hook to run your code which calls wp_insert_attachment. http://www.gravityhelp.com/documentation/page/Gform_after_submission

    Posted 11 years ago on Tuesday April 2, 2013 | Permalink