Skip to content

Instantly share code, notes, and snippets.

@anak10thn
Created January 27, 2013 07:51
Show Gist options
  • Save anak10thn/4647277 to your computer and use it in GitHub Desktop.
Save anak10thn/4647277 to your computer and use it in GitHub Desktop.
<?php
class zip_protect{
private $pass,$out,$input;
function __construct($p,$i,$o){
$this->pass = hash('sha512',$p);
$this->out = $o;
$this->input = $i;
header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=$this->out");
@system("zip -P $this->pass $this->out $this->input");
readfile($this->out);
@unlink($this->out);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment