Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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 ?)
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
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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:
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 ?)
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
is working on a reply...