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 Aug. 21, 2023, 12:09 p.m.