Changeset 524

Show
Ignore:
Timestamp:
04/16/08 13:25:01 (8 months ago)
Author:
sidtheduck
Message:

+ adding modifications to plog-download.php for filesize (download can determine approximate download time based on filesize) and clearing of cache for downloads in the same day (don't know if this is really needed. but added anyway).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/plog-download.php

    r496 r524  
    212212 
    213213        add_photos($checked, $level, $dir, $zipfile);   
    214            
    215         // the next three lines force an immediate download of the zip file: 
     214 
     215        $output = $zipfile -> file(); 
     216 
     217        // the next lines attempt to clear the cache, get the filesize, and force an immediate download of the zip file: 
     218        header("Pragma: public"); 
     219        header("Expires: 0"); 
     220        header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
     221        header("Cache-Control: private",false); 
    216222        header("Content-type: application/octet-stream");    
    217         header("Content-disposition: attachment; filename=plog-package-".date("Y.m.d").".zip");    
    218         echo $zipfile -> file();   
     223        header("Content-disposition: attachment; filename=plog-package-".date("Y.m.d").".zip"); 
     224        header("Content-Length: ".strlen($output)); 
     225        header('Content-Transfer-Encoding: binary'); 
     226        echo $output; 
    219227         
    220228        return;