- LuxionAsked on July 07, 2015 at 06:01 PM
Hi, I've tried various way hinted at on the forum to get the filename of an uploaded file. The Form Calculation widget doesn't return a value and nothing else seems to work.
What is the best way to get this info?
- JotForm SupportabajanAnswered on July 07, 2015 at 09:35 PM
Please upload any file of your choice to this jotform and notice how the filename appears in the Name of uploaded file text box. Here's how this was achieved:
1. After the Name of uploaded file field was added to the form, I created the following Update a form field value (see this screenshot) condition:
2. (Optional step) After saving the condition, the Name of Uploaded file field was set to read-only by going into its properties and selecting Yes for Read-only as illustrated in the following example:
That's pretty much all that was done to have the filename displayed in the text box. Cloning the demo form to your account and examining it may help to clarify the above but if you need further help with this, please inform us.
- JotForm SupportabajanAnswered on July 07, 2015 at 09:48 PM
This guide should be helpful. However, in this instance the Add Field button was clicked to insert the Upload a file "button" into the condition's work area:
- LuxionAnswered on July 08, 2015 at 11:09 AM
Ok, thank you. I'm able to show it in the form, but how can you pass it along when the form is submitted?
- SammyAnswered on July 08, 2015 at 12:37 PM
You can set the name to be outputted in a hidden field or a readonly field as directed by my colleague, by default all fields will be included in your submissions data.
kindly let us know if you need further assistance or clarification
- LuxionAnswered on July 08, 2015 at 02:17 PM
Ok, I see that it's working when I test it in JotForm. I am using the raw code on the site though, so it looks like I'm missing the proper script. What script do I need to call?
- SammyAnswered on July 08, 2015 at 02:21 PM
Since you are using the full code embed you will have to get a fresh copy of the code with the implemented changes.
The full source code usually requires manual updating for the changes to reflect'
Kindly let us know of the outcome
- LuxionAnswered on July 08, 2015 at 03:14 PM
Ok, so we determined that it's three scripts being called, yes, in the full code embed. I did need to make some updates to the form, but once the script was added, the filename input is showing up. Thanks for your help.