fix content-disposition header and generate valid filenames