BUG FIX: file name encoding

file names with spaces etc are now URI encoded so that queries would not
fail.