You are attempting to write to the actual file object rather than the filepath itself. Remove the File.FromPath node and use the File Path node directly instead.