reindent
add function parameter doc, add regexp to remove chars which could break the file download/name header