The File::factory() will only create a file object. What you need to do is update the file, though.
File::factory()