<div class="row"> <p><?php echo _AT('select_directory'); ?> </p> </div> <div class="row"> <ul> <li class="folders"><input type="radio" name="new_folder" value="0" id="fhome" <?php if ($folder_id == 0) { echo ' checked="checked"'; } ?> /><label for="fhome"><?php echo fs_get_workspace($owner_type, $owner_id); ?> </label> <?php if ($folder_id == $current_folder_id) { echo ' ' . _AT('current_location'); } ?> <?php fs_print_folders($folder_id, 0, $folders); ?> </li> </ul> </div> <div class="row buttons">
<input type="hidden" name="folder" value="<?php echo $folder_id; ?>" /> <input type="hidden" name="ot" value="<?php echo $owner_type; ?>" /> <input type="hidden" name="oid" value="<?php echo $owner_id; ?>" /> <div class="input-form"> <div class="row"> <p><?php echo _AT('select_directory'); ?></p> </div> <div class="row"> <ul> <li class="folders"><input type="radio" name="new_folder" value="0" id="fhome" <?php if ($folder_id == 0) { echo ' checked="checked"'; } ?>/><label for="fhome"><?php echo fs_get_workspace($owner_type, $owner_id); ?></label> <?php if ($folder_id == $current_folder_id) { echo ' '._AT('current_location'); } ?> <?php fs_print_folders($folder_id, 0, $folders); ?> </li> </ul> </div> <div class="row buttons"> <input type="submit" name="submit" value="<?php echo _AT('move'); ?>" /> <input type="submit" name="cancel" value="<?php echo _AT('cancel'); ?>" /> </div> </div>
// This header appears to be problematic on some systems Mantis 5014 // see http://atutor.ca/view/3/23234/1.html // Commenting out this header may help header('Content-Length: ' . $row['file_size']); // see the note in get.php about the use of x-Sendfile header('x-Sendfile: ' . $file_path); header('x-Sendfile: ', TRUE); // if we get here then it didn't work @readfile($file_path); exit; } } else { // zip multiple files and folders require AT_INCLUDE_PATH . 'classes/zipfile.class.php'; $zipfile = new zipfile(); $zip_file_name = fs_get_workspace($owner_type, $owner_id); // want the name of the workspace $zip_file_name = str_replace(" ", "_", $zip_file_name); if (is_array($_GET['files'])) { foreach ($_GET['files'] as $file_id) { $file_path = fs_get_file_path($file_id) . $file_id; $sql = "SELECT file_name, UNIX_TIMESTAMP(date) AS date FROM " . TABLE_PREFIX . "files WHERE file_id={$file_id} AND owner_type={$owner_type} AND owner_id={$owner_id}"; $result = mysql_query($sql, $db); if (($row = mysql_fetch_assoc($result)) && file_exists($file_path)) { $zipfile->add_file(file_get_contents($file_path), $row['file_name'], $row['date']); } } } if (is_array($_GET['folders'])) { foreach ($_GET['folders'] as $folder_id) { fs_download_folder($folder_id, $zipfile, $owner_type, $owner_id);
header('Pragma: public'); header('Content-Length: '.$row['file_size']); // see the note in get.php about the use of x-Sendfile header('x-Sendfile: '.$file_path); header('x-Sendfile: ', TRUE); // if we get here then it didn't work @readfile($file_path); exit; } } else { // zip multiple files and folders require(AT_INCLUDE_PATH . 'classes/zipfile.class.php'); $zipfile = new zipfile(); $zip_file_name = fs_get_workspace($owner_type, $owner_id); // want the name of the workspace $zip_file_name = str_replace(" ","_",$zip_file_name ); if (is_array($_GET['files'])) { foreach ($_GET['files'] as $file_id) { $file_path = fs_get_file_path($file_id) . $file_id; $sql = "SELECT file_name, UNIX_TIMESTAMP(date) AS date FROM ".TABLE_PREFIX."files WHERE file_id=$file_id AND owner_type=$owner_type AND owner_id=$owner_id"; $result = mysql_query($sql, $db); if (($row = mysql_fetch_assoc($result)) && file_exists($file_path)) { $zipfile->add_file(file_get_contents($file_path), $row['file_name'], $row['date']); } } } if (is_array($_GET['folders'])) {