Hi Gavin,
I have precisely this issue with a form that I’m working on right now.
What I’ve been told is that this keyword should work:
%response_320400_q4_file_content%
And would return an Array of file contents. However, there is a bug that needs to be fixed which is causing that keyword to create a PHP error.
So, the workaround that I’ve got is the below.
You need to split the uploaded file IDs into individual IDs and then use the ^as_asset
keyword modifier to get the data you need.
That is, this keyword gives you the file name of the first file uploaded:
%response_<parent_id>_<question_id>_file_id^explode:, ^index:0^as_asset:asset_attribute_name%'
And this will give you the contents of the first file uploaded:
%response_<parent_id>_<question_id>_file_id^explode:, ^index:0^as_asset:asset_file_contents^base64encode%
You just increase that index
value for each file you have. So ^index:1
gives you the second file, and so on.
The big catch here is that the files must have a Live Status and be publicly accessible in order for this workaround to work.
Since you are using a form file field you will need to create a new Matrix Trigger to watch for files created in your file upload folder and then set their Status to be Live.