Attachment fields can be accessed in CloudCode with the following JavaScript API. This applies to fields of type="attachment", type="photo" and type="signature".
myobject.photo.present(); // false if not uploaded yetmyobject.photo.url(); // null if not uploaded yetmyobject.photo.processed('fullscreen').url();awaitmyobject.photo.toBuffer();awaitmyobject.photo.toBase64();awaitmyobject.mycsvfile.toText();myobject.photo.toJSON(); // output state and urls in APIv4-compatible JSON.