Title: Set filename
Last modified: August 22, 2016

---

# Set filename

 *  [andreas-egger](https://wordpress.org/support/users/andreas-egger/)
 * (@andreas-egger)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/set-filename/)
 * Hi
    I’m using this plugin for a file upload for the users on my webpage. I have
   already seen that it is possible to set the upload file path with the short code
   editor, but is there any way to **set the file name?**
 * [https://wordpress.org/plugins/wp-file-upload/](https://wordpress.org/plugins/wp-file-upload/)

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

 *  Plugin Author [nickboss](https://wordpress.org/support/users/nickboss/)
 * (@nickboss)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/set-filename/#post-5186812)
 * Hi,
 *  yes you can set the filename but it is not so straightforward. You need to use
   php code and implement wfu_before_file_upload, which gives you the opportunity
   to change the filepath to whatever you want, just before the file is uploaded.
 *  Let me know if you need more instructions on this
 * Nickolas
 *  [leif.odmark](https://wordpress.org/support/users/leifodmark/)
 * (@leifodmark)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/set-filename/#post-5186899)
 * Hello
    I use a plugin called DB-form, but it does not have file upload so therefore
   I use WordPress file upplod for this. Both are entered with the “Short Code” 
   in a page. When I post a picture I want to automatically rename the file to the
   same name as the person entered in the field intended for the name. Something
   like this. Name field: John Doe, file name: john_doe.ext. Can it be done with
   PHP and %filename% or function that you mention above wfu_before_file_upload?
   The site is not upp yet so I can’t show you what I mean. best regards Leif
 *  Plugin Author [nickboss](https://wordpress.org/support/users/nickboss/)
 * (@nickboss)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/set-filename/#post-5186900)
 * What you are asking maybe can be done easier without the need to use PHP.
 * You can add Javascript code inside the page (through the page editor) that hooks
   on the upload button and when upload button is pressed it reads the DB-form field
   value and changes the filename, before it is uploaded.
 * I can help you with that but I would need to have access to the page.
 * Nickolas

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

The topic ‘Set filename’ is closed to new replies.

 * ![](https://ps.w.org/wp-file-upload/assets/icon-256x256.png?rev=3252590)
 * [Iptanus File Upload](https://wordpress.org/plugins/wp-file-upload/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-file-upload/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-file-upload/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-file-upload/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-file-upload/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-file-upload/reviews/)

## Tags

 * [filename](https://wordpress.org/support/topic-tag/filename/)

 * 3 replies
 * 3 participants
 * Last reply from: [nickboss](https://wordpress.org/support/users/nickboss/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/set-filename/#post-5186900)
 * Status: not resolved