java - how to specify the pdfbox.apache filename when downloading/exporting? -


just wondering there way name document after specify doc.name template

  pddocument doc = pddocument.load(play.play.application().resource("/templates/" + filename));    bytearrayoutputstream bytearrayoutputstream = new bytearrayoutputstream();             doc.save(bytearrayoutputstream);             doc.close(); 

therefore, when download pdfbox rendered file, name of pdf file can not specified. there other way it?

i not familiar play framework.

if want enable users download file , provide filename, need set http header

content-disposition: attachment; filename=myfile.pdf 

when browser sees header, user dialog box save file , suggest name myfile.pdf.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -