Iterate over the array of files to upload

Fixes: https://issues.jenkins-ci.org/browse/JENKINS-24255