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();
}
opencpu/opencpu documentation built on April 29, 2024, 10:13 a.m.