Issue with data in Jira Cloud Attachment (API returns file of different size)

Hi everyone.
I was working on the ability to download Jira Cloud attachments using JS and, unfortunately, faced issues with the returned data.

Response text contains this:

After I save file on the disc it messages me:

When I try to get this file using the address line (standard browser downloading) it returns me file with no issues, but here is the difference that I noticed:

The difference is about 20Kb. It’s obviously different bunches of data, but unfortunately, I cannot tell why, because I’m using the same endpoint.

I will appreciate any ideas or help.


Using API endpoint:

function saveFile(blob, filename) {
  if (window.navigator.msSaveOrOpenBlob) {
    window.navigator.msSaveOrOpenBlob(blob, filename);
  } else {
    const a = document.createElement('a');
    const url = window.URL.createObjectURL(blob);
    a.href = url; = filename;;
    setTimeout(() => {
    }, 0)

  url: path,
  success: (responseText) => {
    const blob = new Blob([responseText]);
    saveFile(blob, 'test.docx');
  error: () => {},

Hi @piskunovigorm It’s not possible to get binary date with AP.request, see

1 Like

Thank you @marc. But do you know if this is possible some another way? Let’s say httpClient.get() results are pretty close. Does it mean we need to implement our own solution for that?

You need to go through the server, because of security.