I'm working on a usercontrol (my first ever) with media uploading functionality. The media is typically the avatar of a Member. When a Member uploads an image for the first time a new Media object is created with Media.MakeNew()-method. But when a member already has an avatar, I'd like to reuse the Media object instead of creating a new one. But I can't seem to find a method in the API for fetching a Media object based on node ID. How is this done?
How to get a media object by node id?
I'm working on a usercontrol (my first ever) with media uploading functionality. The media is typically the avatar of a Member. When a Member uploads an image for the first time a new Media object is created with Media.MakeNew()-method. But when a member already has an avatar, I'd like to reuse the Media object instead of creating a new one. But I can't seem to find a method in the API for fetching a Media object based on node ID. How is this done?
regards, Christian
Hmm, seems you can use the constructor. I'm all out of practice.
is working on a reply...