Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-64838

copy pasting png file into RTE causes wrong content type (text/plain) being set on attachment

    XMLWordPrintable

Details

    Description

      Summary

      Ctrl+c ctrl+v of PNG file in RTE  causes wrong content type being set in fileattachment DB row for pasted file. This can cause not rendering images on certain browsers (IE) due to wrong content type returned by com.atlassian.jira.web.servlet.ViewAttachmentServlet

      Environment

      • JIRA 7.3.x

      Steps to Reproduce

      1. go to some issue
      2. drag and drop ctrl+c ctrl+v some png file to the issue, it should be uploaded
      3. copy the url from the uploaded file (from the view issue page)
      4. use some tool to see headers of requested png file eq.
        curl -v -u admin:admin http://localhost:2990/jira/secure/attachment/10016/10016_image-2017-03-16-09-46-48-957.png > test
        gives:
      < Content-Type: text/plain

      where it should be 

      < Content-Type: image/png
      
      1. Also in db there is wrong content type set:
        image-2017-03-16-11-39-49-837.png
      2. also when you copy paste the image url to new tab it will not render properly:
        image-2017-03-16-11-41-54-425.png

      Expected Results

      Content type should be set to proper one eg. image/png and image should be rendered correctly

      Actual Results

      Content type for copy pasted png files is set to text/plain

      Workaround

      use uploading from the menu (it seems to be working fine) 

      Attachments

        1. _thumb_59101.png
          1 kB
        2. image-2017-03-16-11-39-49-837.png
          11 kB
        3. image-2017-03-16-11-41-54-425.png
          476 kB

        Issue Links

          Activity

            People

              tkanafa Tomasz Kanafa
              tkanafa Tomasz Kanafa
              Votes:
              19 Vote for this issue
              Watchers:
              32 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: