2

Attaching images to an issue in YouTrack, using the REST API, the files show up as normal attachments. I cannot view them hovering the item by mouse, instead I always have to download the files to have them displayed (which is annoying).

When I upload an image manually in the web UI, the image is displayed right away. What am I doing wrong, or rather how does YouTrack decide how to provide attachments to the user in web UI?

I'm using Apache's MultipartEntityBuilder to create the MIME body of the REST request, setting the ContentType to ContentType.APPLICATION_OCTET_STREAM. Should I set it to some sort of image MIME type when uploading?

user1438038
  • 5,821
  • 6
  • 60
  • 94

1 Answers1

2

setting the ContentType to ContentType.APPLICATION_OCTET_STREAM

YouTrack decides to let the file be previewed or downloaded based on its content type. application/octet-stream is not considered a safe one, thus, no file preview is allowed.

Use one of the following "safe" mime types depending on the image type: image/gif, image/jpeg, image/png.

Jk1
  • 11,233
  • 9
  • 54
  • 64