Answers.Body: <p><a href="https://sprout.barrelstrengthdesign.com/docs/forms/events-and-hooks.html#events" rel="nofollow noreferrer">Sprout forms has hooks</a> you can latch on to in your own custom module/plugin, so when a form is saved you can grab the asset and re-name at that point.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-16T11:56:03.647Z
Answers.LastActivityDate: 2020-07-16T11:56:03.647Z
Answers.UserDisplayName: dmatthams
Body: <p>I have a contact form where users have to fill in a name field and upload a file.  I want to add the name the user filled in to the beginning of the filename, eg: firstname-lastname_filename.pdf.  I am using Sprout Forms for Craft 3, both the most up to date versions.</p>
  <p>Is this something I can do with original Sprout Forms functionality, or will I have to write a custom module or plugin to inject this code?  Essentially, what I understand is I will have to find the code in Sprout Forms where the file is uploaded, and inject the code to add the special user submitted name data.</p>
  
Tags: <craft3><plugin-sproutforms><files>
Title: How to prepend user input data to a filename uploaded through Sprout Forms
ThreadText: # How to prepend user input data to a filename uploaded through Sprout Forms
  
  (Asked by: username_0 on 2020-07-15)
  
  I have a contact form where users have to fill in a name field and upload a file. I want to add the name the user filled in to the beginning of the filename, eg: firstname-lastname\_filename.pdf. I am using Sprout Forms for Craft 3, both the most up to date versions.
  
  Is this something I can do with original Sprout Forms functionality, or will I have to write a custom module or plugin to inject this code? Essentially, what I understand is I will have to find the code in Sprout Forms where the file is uploaded, and inject the code to add the special user submitted name data.
  
  **Tags:** craft3, plugin-sproutforms, files
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-07-16. Score: 2
  
  [Sprout forms has hooks](https://sprout.barrelstrengthdesign.com/docs/forms/events-and-hooks.html#events) you can latch on to in your own custom module/plugin, so when a form is saved you can grab the asset and re-name at that point.
  
  
  ---
  
  