Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 19872cd983
Fetching contributors…

Cannot retrieve contributors at this time

76 lines (62 sloc) 2.288 kb
<?php
/*
* LimeSurvey
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
* All rights reserved.
* License: GNU/GPL License v2 or later, see LICENSE.php
* LimeSurvey is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*
* $Id: export_resources_zip.php 11664 2011-12-16 05:19:42Z tmswhite $
*/
include_once("login_check.php");
if (!isset($surveyid))
{
returnglobal('sid');
}
if (!isset($lid))
{
returnglobal('lid');
}
if ($action == "exportsurvresources" && $surveyid) {
require("classes/phpzip/phpzip.inc.php");
$z = new PHPZip();
$resourcesdir=$uploaddir. "/surveys/$surveyid/";
$zipfile="$tempdir/resources-survey-$surveyid.zip";
$z -> Zip($resourcesdir, $zipfile);
if (is_file($zipfile)) {
//Send the file for download!
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header( "Content-Disposition: attachment; filename=resources-survey-$surveyid.zip" );
header( "Content-Description: File Transfer");
@readfile($zipfile);
//Delete the temporary file
unlink($zipfile);
}
}
if ($action == "exportlabelresources" && $lid) {
require("classes/phpzip/phpzip.inc.php");
$z = new PHPZip();
$resourcesdir=$uploaddir. "/upload/labels/$lid/";
$zipfile="$tempdir/resources-labelset-$lid.zip";
$z -> Zip($resourcesdir, $zipfile);
if (is_file($zipfile)) {
//Send the file for download!
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header( "Content-Disposition: attachment; filename=resources-label-$lid.zip" );
header( "Content-Description: File Transfer");
@readfile($zipfile);
//Delete the temporary file
unlink($zipfile);
}
}
?>
Jump to Line
Something went wrong with that request. Please try again.