Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Changing mime type of a file does not enable preview

Tom Barringer
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 24, 2022

v7.8.3 on Linux, with a Linux web client.

When I upload 'file.sh' (a text shell script) to an attachments page, the mime type is set to "application/octet-stream" and the file cannot be previewed. If I change the mime type to "text/plain" and rename the file to 'file.txt' I still cannot preview it.

Conversely if I upload 'file.txt' (the same file) the mime type is set to 'text/plain' and I can preview it, even if I rename the file and change the mime type.

The old mime type appears to be preserved somewhere for the life of the file, and it is that type that controls the preview-ability of the file. Is there a way to reset this type so that the file can be previewed?

1 answer

0 votes
WW
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 26, 2022

<stepping up on soapbox>

Please put content into Confluence pages. Confluence is not a file repository.

<stepping off of soapbox>

If your intent is to view the contents of the file, it'd be a whole lot nicer to just copy and paste the contents into a Code Block macro. There you can do things like specify the language, add line numbers, make it collapsible, and name the thing.

If you must, you can also upload the file to have a copy of it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events