c# - Set .pdf name but prevent download with Rotativa -


i need set .pdf name before displaying it. tried set this

return new viewaspdf(getviewname(), "", reportvm)  {     pagesize = size.letter, filename = getviewname() + "-" + datetime.now.toshortdatestring() + ".pdf"  }; , 

but in way .pdf automatically downloaded. possible set .pdf name , not downloading it?

thanks!

after long research, answer no. thing set file name using response header , remove property filename, code now:

response.appendheader("content-disposition", "inline; filename=" +getviewname() + "_" + datetime.now.toshortdatestring() + ".pdf"); return new viewaspdf(getviewname(), "", reportvm) { pagesize = size.letter }; 

maybe there better solution, that's best after reading. hope others too!


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -