allow filename to be empty for direct browser output