Title: Add filelink to database
Last modified: August 19, 2021

---

# Add filelink to database

 *  Resolved [davad0925](https://wordpress.org/support/users/davad0925/)
 * (@davad0925)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/add-filelink-to-database/)
 * I write a code in your gb-form.php that is about user uploading their file,and
   I want to add this file link to database. How did you do to upload comment to
   database,which file is about that.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Marcel Pol](https://wordpress.org/support/users/mpol/)
 * (@mpol)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/add-filelink-to-database/#post-14803893)
 * Hi,
    I do hope you only enable this for logged-in users. I don’t dare to add 
   this feature since I am not confident enough that I would be able to guarantee
   there are no spam uploads, or even worse, for users of this plugin.
 * Also, it is better to not edit the plugin files directly, they will be overwritten
   with every update. WordPress uses the filter and action api for extending functionality.
 * For adding the form field, you can use the filter `gwolle_gb_write_add_after_content`
   documented here:
    [https://plugins.trac.wordpress.org/browser/gwolle-gb/trunk/docs/filters/gwolle_gb_write_add_after_content.txt](https://plugins.trac.wordpress.org/browser/gwolle-gb/trunk/docs/filters/gwolle_gb_write_add_after_content.txt)
 * Then for the submission of the form, you could use the action `gwolle_gb_save_entry_frontend`
   that is documented here:
    [https://plugins.trac.wordpress.org/browser/gwolle-gb/trunk/docs/actions/gwolle_gb_save_entry_frontend.txt](https://plugins.trac.wordpress.org/browser/gwolle-gb/trunk/docs/actions/gwolle_gb_save_entry_frontend.txt)
   You want to look at WordPress functions like `media_sideload_image` for adding
   an uploaded image to the Media Library.
 * And then for displaying the uploaded image you could use the filter `gwolle_gb_entry_read_add_content`
   that is documented here:
    [https://plugins.trac.wordpress.org/browser/gwolle-gb/trunk/docs/filters/gwolle_gb_entry_read_add_content.txt](https://plugins.trac.wordpress.org/browser/gwolle-gb/trunk/docs/filters/gwolle_gb_entry_read_add_content.txt)
 * With these 3 hooks, 2 filters and 1 action, you can create your own plugin that
   is an extension of this plugin.
 *  Thread Starter [davad0925](https://wordpress.org/support/users/davad0925/)
 * (@davad0925)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/add-filelink-to-database/#post-14815860)
 * Where do I write these filters?
    Is gb-form.php?
 *  Plugin Author [Marcel Pol](https://wordpress.org/support/users/mpol/)
 * (@mpol)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/add-filelink-to-database/#post-14815873)
 * Hi,
 * You could create your own plugin with that. You can also add it to functions.
   php of your theme, preferably a child theme.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Add filelink to database’ is closed to new replies.

 * ![](https://ps.w.org/gwolle-gb/assets/icon-256x256.png?rev=1114688)
 * [Gwolle Guestbook](https://wordpress.org/plugins/gwolle-gb/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gwolle-gb/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gwolle-gb/)
 * [Active Topics](https://wordpress.org/support/plugin/gwolle-gb/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gwolle-gb/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gwolle-gb/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Marcel Pol](https://wordpress.org/support/users/mpol/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/add-filelink-to-database/#post-14815873)
 * Status: resolved