Way to delete attachment

I managed to code on how to attach the document in the form but failed to code on how to remove the attachment.

Anybody can help me on this.