when encoding the filename, using encodeURLComponent instead of encodeURL