Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $url = "https://jira.account/secure/attachment/".$attachment_id."/".$attachment_name."?os_username=". $username ."&os_password=" . $password;
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- $file = curl_exec($ch);
- curl_close($ch);
- if($file){
- header('Content-Description: File Transfer');
- header('Content-Type: application/zip');
- header('Content-Disposition: attachment; filename='.$attachment_name);
- header('Expires: 0');
- header('Cache-Control: must-revalidate');
- header('Pragma: public');
- echo ($file);
- exit;
- }else{
- throw new Exception("Error: file now found.");
- }
Add Comment
Please, Sign In to add comment