I had an issue with import attachment into Jira via JSON importer. We include a route without login to retrive attachment from a server.
Every Time when i try to import the attachment this message is displayed:
"An exception occurred dealing with attachment "
This message is to general to know what is the problem. We have a script to return an attachment and i think we missing some config to work jira with.
$attachment = $_GET['attachment'];
$base_path = '/var/www/folder_to_file/';
$img_path = $base_path.$attachment;
$mime_type = mime_content_type($img_path);
header('Content-Type: '.$mime_type);
header('Content-Length: ' . filesize($img_path));
$img_info = getimagesize($img_path);
$img = readfile($img_path);
return $img;
I think here is some header config missing. I have try to add this config, without success.
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename="'.basename($img_path).'"');
header('Expires: 0');
header('Cache-Control: public');
header('Pragma: public');
Maybe somebody had deal with the same issue and can tell me how can i fix it.
Thanks Jamie