utilize mimetype from type, don't keep file open