Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Which information is for an import for attachments in JSON importer requiered?

Jamie Ciocan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 18, 2020

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  

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events