Properly handle filenames containing spaces when exporting an archive. Fixes #2856