Detect mimetype when streaming files