upload multiple files and replace spaces for underscores.

I'm using the fileUploader to upload a number of files. Should any files have a space I'd like to replace it with an underscore.
To achieve this I've written the following code :

a!fileUploadField(

target:cons!Gen_FolderLocation,
maxSelections: 10,
fileNames: substitute(
                     fv!file.name,
                     " ",
                     "_"
                     ),
value: ri!fileList,
saveInto:{ri!fileList,

When I upload a single file everything works. However when I upload multiple files it does not work.

  Discussion posts and replies are publicly visible