I have some EML Files with attachments. I’ve parsed the EML files pulled out the attachments, and if I do this :
File.WriteAllBytes(attachment.Name, Convert.FromBase64String(attachment.Data))
I get the attachment dumped to a file. What I want to do is have a link so that when the user clicks on it, the attachment downloads.
Easy enough if its a file already on disk, but instead I have this base64encoded string that I can convert to a byte array. How can I take this base64encoded string (or the converted byte array) and generate a link directly to that?
Thanks
You would return back a
FileResultclass with the data from some other action method:Your link would then point here: