File: sendBin.r

package info (click to toggle)
rapache 1.2.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,248 kB
  • sloc: sh: 18,629; ansic: 10,417; perl: 5,675; javascript: 2,800; makefile: 307
file content (9 lines) | stat: -rw-r--r-- 197 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
setContentType("image/png")
t <- tempfile()
png(t,type="cairo")
plot(rnorm(10))
dev.off()
setHeader('Content-Length',file.info(t)$size)
sendBin(readBin(t,'raw',n=file.info(t)$size))
unlink(t)
DONE