R/httpget_session_tar.R

Defines functions httpget_session_tar

httpget_session_tar <- function(sessionpath, requri){
  setwd(sessionpath);
  tmptar <- tempfile(fileext=".tar.gz");
  utils::tar(tmptar, files=".", compression="gzip");

  #continue
  res$setbody(file=tmptar);
  res$setheader("Content-Type", "application/x-gzip")
  res$setheader("Content-Disposition", paste('attachment; filename="', basename(sessionpath), '.tar.gz"', sep=""));
  res$finish();
}
jeroen/opencpu documentation built on Nov. 18, 2018, 7:04 a.m.