user1826240
user1826240

Reputation: 95

VB: Return a pdf without create

I'm developing a MVC web app in VB.Net and I have a pdf in base64 string format. It's possible to return that pdf to the view and see it, without creating a temp.pdf file?

Upvotes: 0

Views: 223

Answers (1)

Damien_The_Unbeliever
Damien_The_Unbeliever

Reputation: 239804

You say in a comment that you want something like:

Return File(System.AppDomain.CurrentDomain.BaseDirectory & "\file.pdf", "application/pdf")

So why not simply:

Return File(Convert.FromBase64String(base64string),"application/pdf")

References:

Convert.FromBase64String File

Upvotes: 2

Related Questions