Ignore:
Timestamp:
Jul 11, 2012, 12:58:19 PM (12 years ago)
Author:
mistic100
Message:

-add complete breadcrumb
-AJAX for remove photos (more faster)
-use try/catch for error handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/BatchDownloader/download.php

    r16379 r16609  
    33include(PHPWG_ROOT_PATH.'include/common.inc.php');
    44
    5 // check_status(ACCESS_CLASSIC);
     5check_status(ACCESS_CLASSIC);
    66
    7 $BatchDownloader = new BatchDownloader($_GET['set_id']);
    8 $file = $BatchDownloader->getArchivePath();
     7try {
     8  $BatchDownloader = new BatchDownloader($_GET['set_id']);
     9  $file = $BatchDownloader->getArchivePath();
    910
    10 header('Content-Type: application/force-download; name="'.basename($file).'"');
    11 header('Content-Disposition: attachment; filename="'.basename($file).'"');
    12 header('Content-Description: File Transfer');
    13 header('Content-Transfer-Encoding: binary');
    14 header('Content-Length: '.filesize($file).'');
     11  header('Content-Type: application/force-download; name="'.basename($file).'"');
     12  header('Content-Disposition: attachment; filename="'.basename($file).'"');
     13  header('Content-Description: File Transfer');
     14  header('Content-Transfer-Encoding: binary');
     15  header('Content-Length: '.filesize($file).'');
    1516
    16 header('Cache-Control: no-cache, must-revalidate');
    17 header('Pragma: no-cache');
    18 header('Expires: 0');
     17  header('Cache-Control: no-cache, must-revalidate');
     18  header('Pragma: no-cache');
     19  header('Expires: 0');
    1920
    20 readfile($file);
     21  readfile($file);
     22}
     23catch (Exception $e)
     24{
     25  echo $e->getMessage();
     26}
     27   
    2128exit(0);
    2229
Note: See TracChangeset for help on using the changeset viewer.