How to fetch file/attachment from html form message/data?

I am creating activity i.e mail.activity in odoo with some attachment but when I create activity my activity created in html format.

<html><p><img class="img-fluid o_we_custom_image" src="undefined?access_token=9dd94d60-651f-4832-8cf0-26bc70330138" title=""><a href="/web/content/288?access_token=9dd94d60-651f-4832-8cf0-26bc70330138&amp;unique=5d8a7b0d2393d51df422782ad0daea40c123b12f&amp;download=true" class="o_image o_we_selected_image" title="index.html"></a> <br></p></html>

In above html my attachment is index.html how I fetch it or how can I get that file.