Index: preset.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/data/preset.php,v retrieving revision 1.24.2.3 diff -u -r1.24.2.3 preset.php --- mod/data/preset.php 16 Apr 2008 03:23:09 -0000 1.24.2.3 +++ mod/data/preset.php 31 May 2008 11:52:32 -0000 @@ -187,18 +187,20 @@ if (!data_submitted() or !confirm_sesskey()) { error("Invalid request"); } - + $exportfile = data_presets_export($course, $cm, $data); + $downloadsubdir = "$course->id/moddata/data/$data->id"; + $filename = clean_filename($data->name . '-preset-' . gmdate("Ymd_Hi") . '.zip'); + $downloadfile = "$CFG->dataroot/$downloadsubdir/$filename"; + @unlink($downloadfile); + + // Move the exported zip to the download folder + make_upload_directory($downloadsubdir); + if (! rename($exportfile, $downloadfile)) { + error('Can\'t move preset ZIP file to download location'); + } echo '