Gaurav,
it don't talk about how to stream contents of attached file
Try using CMS.DocumentEngine.AttachmentBinaryHelper.GetAttachmentBinary()
Then use that binary data of the attachment as you want, which is unrelated to Kentico Xperience and more a question of how you want to process it with ASP.NET Core.