Fix chrome duplicated header

A couple of fixes.

The main one only affect Chrome browser with some filenames. If you have a filename with some spaces and a comma inside you'll get the `ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION` error

The other problem came with some files, where calling `chardet.detect(data)` returns `{'confidence': 0.0, 'encoding': None}`. This will raise an exception.