Fix content type on download export file
close file on finish read generate file