Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • olst 69 posts 88 karma points
    Nov 06, 2011 @ 18:40
    olst
    0

    delete media (image) that is a member type property

    Hi.

    I have a member type which includes an upload property called "picture".

    Now, suppose I've uploaded an image and now I want to delete it:

    I'm trying the following code:

    Member member = Member.GetCurrentMember();
    
            var media = new Media(member.getProperty("picture").Id);
            media.delete();

    my questions are:

    1. Is this the correct way to get a reference to the "picture" property underlying media ?

    2. Is this the right way to delete the media ? (what does the overload of delete - "delete permenantly" mean ?)

  • Richard Soeteman 4049 posts 12922 karma points MVP 2x
    Nov 07, 2011 @ 08:32
    Richard Soeteman
    0

    Hi,

    This is the best way to get the underlying media indeed. Maybe you could add check for null values on media. and the delete permenantly means that it won't be added to the recycle bin but just deleted.

    Cheers,

    Richard

Please Sign in or register to post replies

Write your reply to:

Draft