PHP does not allow casting an existing object to a different class. And I think that creating a new file when writing just to have the right subclass is not worth it. It will be confusing for people if a new object appears (and will ask you whether they should use the new one or can keep using the old one). If you want to work with a GridFS file, do it from the start.