SHARE
TWEET

Untitled

a guest Jun 18th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. val xmlContent: Enumerator[Elem] = ..
  2. val streamContent: Enumerator[Array[Byte]] = Enumerator.outputStream { os =>
  3.            val zip = new ZipOutputStream(os)
  4.            zip.putNextEntry(new ZipEntry("report.xml"))
  5.            xmlContent.map{node=> zip.write(node.mkString.getBytes)}
  6.             zip.closeEntry()
  7.             zip.close()
  8.         }
  9. Ok.chunked(streamContent >>> Enumerator.eof).as("application/zip").withHeaders(
  10.           CONTENT_DISPOSITION -> "attachment;")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top