EDIT: SOLVED -> Here's the rambling innefficient solution I devised with some thanks to Max.
Let's say we have a file field called myFile on the form.
Generate part of the filename using a Modify Data action, which we will call fileNameGenerator and set the data provider field to whatever you need, e.g. {user:name}_{rand:} - this step is required if you want all the files uploaded to your server in this form submission to have the same string in their name
If you want the field name to be in the uploaded file name you'll need an upload file action for each field.
For each field that needs a unique name, you need a separate upload action (for some reason).
Set File name provider in your upload action to {var:fileNameGenerator}<whatever else you want>.{var:<name of your upload action>.file.extension}
So if my upload action is named (the black label) upload54, and my file field is called myFile, and I want my file uploaded to the server as <user name>_<a random number>_<the name of the file field>.<the file extension> then it would be {user:name}_{rand:}_<the name of the file field>.{var:upload54.file.extension} or I can put {var:fileNameGenerator} in there somewhere to use the string we generated earlier.
USING IT IN PHP
OK so you've uploaded the file to the server and now for whatever reason you want to access it in a PHP action (which has to come AFTER the file upload action!).
$this->get("<file upload action>", ""); which gives us an array of field names, with each field name being another array with the uploaded path, the filename, the name of the original file as uploaded by the user, and the size.
So if I want to get the full path of the uploaded image as it is on my server, with an upload action called upload5 and a file field called myFile, I would use $this->get('upload5', '')['myFile']['path']
=========================================
Original message
I have a Modify Data action that generates a prefix using {data:firstName}_{data:lastName}_{uuid:} that I access using {var:fileNameGenerator}.
I have several file fields. Let's call the fields alphaField, betaField, deltaField.
When uploading the files to the server, I want them called {var:fileNameGenerator}_fieldName.extension
Help would be appreciated.
Let's say we have a file field called myFile on the form.
Generate part of the filename using a Modify Data action, which we will call fileNameGenerator and set the data provider field to whatever you need, e.g. {user:name}_{rand:} - this step is required if you want all the files uploaded to your server in this form submission to have the same string in their name
If you want the field name to be in the uploaded file name you'll need an upload file action for each field.
For each field that needs a unique name, you need a separate upload action (for some reason).
Set File name provider in your upload action to {var:fileNameGenerator}<whatever else you want>.{var:<name of your upload action>.file.extension}
So if my upload action is named (the black label) upload54, and my file field is called myFile, and I want my file uploaded to the server as <user name>_<a random number>_<the name of the file field>.<the file extension> then it would be {user:name}_{rand:}_<the name of the file field>.{var:upload54.file.extension} or I can put {var:fileNameGenerator} in there somewhere to use the string we generated earlier.
USING IT IN PHP
OK so you've uploaded the file to the server and now for whatever reason you want to access it in a PHP action (which has to come AFTER the file upload action!).
$this->get("<file upload action>", ""); which gives us an array of field names, with each field name being another array with the uploaded path, the filename, the name of the original file as uploaded by the user, and the size.
So if I want to get the full path of the uploaded image as it is on my server, with an upload action called upload5 and a file field called myFile, I would use $this->get('upload5', '')['myFile']['path']
=========================================
Original message
I have a Modify Data action that generates a prefix using {data:firstName}_{data:lastName}_{uuid:} that I access using {var:fileNameGenerator}.
I have several file fields. Let's call the fields alphaField, betaField, deltaField.
When uploading the files to the server, I want them called {var:fileNameGenerator}_fieldName.extension
Help would be appreciated.