You are here

function patterns_download_zip in Patterns 7

Same name and namespace in other branches
  1. 7.2 includes/io/download.inc \patterns_download_zip()
1 call to patterns_download_zip()
patterns_export_to_zip in patterns_export/finalize.inc
Exports patterns as a donwlodable Zip archive

File

includes/io/download.inc, line 61
Importing Patterns from a file or using an URL.

Code

function patterns_download_zip($zip_path) {
  $filename = pathinfo($zip_path, PATHINFO_BASENAME);
  drupal_add_http_header("Content-type", "application/octet-stream");
  drupal_add_http_header("Content-Disposition", "attachment;filename=" . $filename);
  $err = @readfile($zip_path);
  if ($err == FALSE) {
    drupal_set_message("An error occurred: couldn't read " . $zip_path . ".", 'error');

    // TODO: t()
  }

  //@drupal_unlink($zip_path);
  exit;
}