Pass file_name into file_action method

`file_name` is a local variable that exists outside of the `file_action` method. In order to use it, it must be passed into the method.