415 unsupported media type status code while trying to insert txt file with Chinese and English characters

XMLWordPrintable

    • 1
    • Severity 3 - Minor

      Atlassian Update - 24 July 2024

      PLEASE NOTE: This is not a bug but intended behaviour. Text files (.txt) are unsupported for preview in Confluence. Please refer to the Preview a file section in the documentation for the list of supported preview types.

      Issue Summary

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Create new page
      2. Insert attached text file with both Chinese and English characters
      3. Publish page.
      4. Preview attached file

      Expected Results

      Both Chinese and English characters should appear 

      你好
      hello world 

      Actual Results

      Only English characters are visible.

      The access log file reports a 415 Unsupported Media Type status

      [01/Jul/2024:10:40:01 +0800] uf102867 https-jsse-nio-8443-exec-65 10.199.176.42 HEAD /confluence/rest/documentConversion/latest/conversion/convertHD/23888002/2?_=1719801579418 HTTP/1.1 415 3ms - https://secureatc-test.bmwbrill.cn/confluence/display/~uf102867/test?preview=/23887984/23888002/123.txt Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 

      with corresponding HAR entry

              "request": {
                "method": "HEAD",
                "url": "https://instenv-319155-jzdi.instenv.internal.atlassian.com/rest/documentConversion/latest/conversion/convertHD/1638402/1?_=1720068141916",
      ....
                  {
                    "name": "referer",
                    "value": "https://instenv-319155-jzdi.instenv.internal.atlassian.com/display/TEST/Test+Page?preview=/1638401/1638402/123.txt"
                  },
      
              "response": {
                "status": 415,
                "statusText": "",
                "httpVersion": "http/2.0",
                "headers": [
                  {
                    "name": "content-encoding",
                    "value": "gzip"
                  },
                  {
                    "name": "content-type",
                    "value": "text/html"
                  }, 

      This issue only occurs when previewing txt files with both Chineses and English characters

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

        1. 123.txt
          0.0 kB
          Alexander Kouvchinov

            Assignee:
            Lei Wang
            Reporter:
            Alexander Kouvchinov (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: