file as a variable name is a little too generic. Maybe file_name, or file_object.

Is file sanitized here? We don't want to be passing around untrusted data, especially not if it's touching the filesystem.