Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Image Issue Attachment via REST API Corrupts Image Edited


I am trying to attach a PNG to an issue on a Jira Cloud project via the Jira Cloud REST API (v3). However, the resulting image attachment on Jira is corrupted. I also get a 200 response back from the API.

Here's the thumbnail for the corrupted image:

Screenshot 2021-02-24 163026.png

I am uploading the attachment with the property name "file", I am sending it as a `multipart/form-data`, and I am not explicitly setting the Content-Type header.

The image is sourced from a web client, where I then create a FormData object, attach the image (as a blob with its mime type set to 'image/png'), and post it to Jira through a proxy. The blob's binary data is correct - I double checked this by 1) converting it to a data URI and then converting that to a PNG with an online conversion tool, and 2) by saving it to a file on my computer and hexdumping it. 

My proxy does not modify the request except for adding a few unrelated headers. I am using `express-http-proxy` with `serverless-http` on AWS Lambda/Serverless Framework. I am using Node v12.

Below is the hexdumps for the correct/uncorrupted image before it is sent to Jira (right) and the corrupted image after being sent to Jira (left)

Screenshot 2021-02-24 163505.png

Note that the corrupted image (left) does not conform to PNG's required header, while the uncorrupted one does. Also notice that there seem to be chunks within the corrupted image that match chunks within the correct image, albeit displaced a few bytes. This could be a coincidence. 

Sending the correct file using cURL works fine. Here's the relevant portion of the log:

> POST /rest/api/3/issue/WT-17/attachments HTTP/2
> Host:
> Authorization: Basic <redacted>
> User-Agent: curl/7.58.0
> Accept: */*
> X-Atlassian-Token: no-check
> Content-Length: 195878
> Content-Type: multipart/form-data; boundary=------------------------b1d0e3f361744ee0

Here are the request headers from Chrome DevTools:

Screenshot 2021-02-24 164038.png

Here is the top part of the request body:

Screenshot 2021-02-24 164146.png

Notice that the header is valid.


Any ideas for what's going on? Let me know if I can provide any more information.

1 answer

0 votes
Prince Nyeche Community Leader Feb 24, 2021

Hi @Wafir Admin 

Welcome to community! You mentioned you're not explicitly setting the headers. Why don't you try setting it and see if the result is different? Probably that could be the issue here. From what you explained, if the binary data can be converted back to an image then for the most part of it, the data is correct. 

Hi Prince,

Thank you for the response. Per this article, this seems unadvised. I attempted it anyways to no avail. Either way, the Content-Type header was being properly set by the browser and was left unmodified via the proxy.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Marketplace Apps & Integrations

New Cloud Apps Roundup - Spring 2021

Atlassian's marketplace partners have had a very productive start to 2021! Since our last roundup, our developer community has added over 160 new cloud apps to the Atlassian Marketplace to help you...

129 views 3 15
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you