This would be clearer if you changed the argument 'file' to 'fileinfo', to indicate that the argument is not a file, but a db record.