Deleting an attachment

Deleting an attachment

by Tim Allen -
Number of replies: 8
Hi moodlers, I have a simple question:

How do I delete (not replace) an attachment to a forum post?

Thanks in advance,
Tim.
Average of ratings: -
In reply to Tim Allen

Re: Deleting an attachment

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Tim,

AFAIK, if you edit your post then any attachment is removed i.e. you need to re-attach a file after editing a post if you don't want it to be removed.

wild girl smile
In reply to Helen Foster

Re: Deleting an attachment

by Darren Smith -
That never used to be the case - I've had the same problems also.

Let's test it. Original post with text doc attached.

Edit: There is now no attachment in the browse box

Edit of the edit: Yeah thought so, you can't delete attachments once you have posted. The best you can do is replace the original with a new dummy attachment
Average of ratings: Useful (1)
In reply to Darren Smith

Re: Deleting an attachment

by N Hansen -
It is possible to do this. You have to go find the file in the Moodledata folder and delete it from there. Right clicking on the attachment and looking at its properties should tell you where it is stored. Just go there, delete it, and it will be like it never existed.
In reply to N Hansen

Re: Deleting an attachment

by Darren Smith -

Fair point but I don't want to give my users access to the moodledata folder surprise
In reply to Darren Smith

Re: Deleting an attachment

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
No, Helen is right. It used to work that way (but I don't know at all in wich version this behaviour changed)

It's true there should be a more elegant way to delete an attachement.
Think abouth how it can be done and file a bug!
In reply to koen roggemans

Re: Deleting an attachment

by Tim Allen -
Thanks for all your replies.  I thought that there was no way to do this and this seems to be correct.  It is really a necessary feature I think, so I have filed a bug on this...
In reply to Tim Allen

Re: Deleting an attachment

by Roland Gesthuizen -

Actually I don't mind if the attachment stays attached. Would be a pain to go back and dig it up after re-editing a post to fix up a typo. Perhaps the attachament viewed should appear the same way as assignments uploaded with the addition of an 'X' icon or delete button to remove.

In reply to Roland Gesthuizen

Re: Deleting an attachment

by Darren Smith -
There are a few issues here to be considered:

When should a student be allowed to delete an attachment?
I would say this should be the same as the max editing time on a post (perhaps configurable for never, max editing time, anytime)

When should a teacher be allowed to delete an attachment?
At any time

Any other options?
Hide attachment option for teacher when viewing posts perhaps?
Choose whether to embed image / multimedia or just show as attachment?

What should the edit interface look like?
Currently it is not shown! Not even in the browse box so new moodlers may not realise it is still attached. I like the idea of an X icon for both student editing and teacher viewing as mentioned above