fix(exportfile): Correctly handle empty index arg (refs #4543)

An incorrect test on the $index variable would prevent exporting a
single file from a file attribute.
Merge pull request #1090 from eguaj/3.3-A4543

fix(exportfile): Correctly handle empty index arg (closes #4543)