Forums

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

Preview for sql attachments

Tor Brondbo July 3, 2018

I want to add preview for .sql attachments. Preview like .txt files is OK.

Is there any way to add this?

2 answers

2 votes
Mirek
Community Champion
July 3, 2018

Add a ".txt" extension and upload to confluence. For example if you file is "exampleSQL.sql" then rename to "exampleSQL.sql.txt". When you would like to use the file download and remove "txt".

Tor Brondbo July 3, 2018

If you don't know the answer to the question, why reply?

Mirek
Community Champion
July 3, 2018

@Tor Brondbo- Let me clarify. You asked a question how to view SQL files that you attach to Confluence to be viewable like TXT files for example. I gave you one one the solutions (workarounds) to achieve that, so that you can preview file without downloading it. Simply treat it as a text file (which .sql files are just with different extension). This is how I understand your question. If you do not like that solution or it is not answering your question that is completely fine. Here on Community people ask questions and there are not always 100% perfect solutions or suggestions. Sometimes those do not simply exist. I gave you an idea, maybe someone else have their own solution (and will post it) and if you like it better you can later "Accept as a solution" that is next to every reply. Thanks to that we can gratuitously share ideas with each other . If you pay for maintenance you can go directly with your questions to Atlassian support or create an improvement/suggestions request on https://jira.atlassian.com/ if the feature do not exist in current version of the application.

Tor Brondbo July 3, 2018

Well, I didn't, I asked a question about how to get preview of .sql files attached to Confluence, i.e. files with the extension '.sql'.

Mirek
Community Champion
July 3, 2018

So, in that case you cannot (using standard OOTB functions without any plugin or workaround). Some time ago it was not even possible to preview .txt files... People would like to also have a preview of , js, .java, .ods, .msg, .html .. you would like to have .sql but this is not currently supported (only - JPEG /DOC/PDF/PNG/DOCX/TIFF/PPT/PSD/PPTX/WMF/XLS/EMF/XLSX/ICO/ICNS)

For others users that would like to see the workaround that I propose in action, this is how preview looks in Confluence. I hope it helps someone.

sql_files.png

0 votes
Adam Dylla
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!
November 2, 2018

I've found that if you edit the Properties of the attachment and set the mime type to 'text/plain', then via the attachments view (click the paper clip icon at the top above the page title) then when you click on the item it will preview as a text file.  Note this still does not make it work via the main page links.

We were able to use the Attachment macro and added file comments to the files and it works well enough.

Robert Ross
Contributor
March 2, 2022

This is not working for me at all.  I fully expected this to work the second I saw the "New Content Type" with a MIME specification in it.  However, it still says it cannot preview.

download.pngdownload.png

Joshua Littlefield
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!
April 19, 2022

I did this on 6 .sql attachments where I had this issue. After a little while (not sure if time is needed), when I click on them from the attachments display, 3 of them display as text, while the other three still say they can't preview. I can't determine anything different between the ones where it worked and those where it did not.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events