Confluence HTML Page URL. Viewing Files from a local file server?
Please can someone help?
I need to view external source files(pdf, doc, xls, txt) from a local windows file server in a Confluence Page. The local files(Many Thousands) are stored on a Windows Server that has not got the correct file extensions by default, but I do have the correct metadata information to work out the correct file extensions to use within the Confluence Page.
The Web Browser is Windows Edge Chromium. Security and GP restrictions will not allow the local File: URL's to be double clicked on the Confluence Page URL Link.
Is there a way to temporarily copy the source file locally, rename the file, then open that file by the extension type or by a third party viewer?
Any other suggestion to meet this requirement would be greatly appreciated?
Thank you for your reply.
The Confluence page has a 'Select2' Dropdown Picker created by a Confluence Scriptrunner Macro. This Gets the JSON Metadata from a Confluence Scriptrunner Rest API(External MS SQL Stored Procedure).
There are 10,000's of potential files to choose from, so I can only add the selected File URL one at a time.
Please can you recommend any technologies / examples to achieve this i.e:
1) From within the same Confluence Scriptrunner Macro or an embedded Macro do you think I could use a Confluence API via AJAX or Groovy Objects to upload the selected URL file as a Confluence page Attachment? I'm using a MS Edge Chromium Browser. Potential permission issues with the external windows server file path and file transfer capabilities?
2) From within the same Confluence Scriptrunner Macro or an embedded Macro do you think I could use groovy script to copy a File URL directly to a Confluence Server directory?
3) Using an Atlassian Marketplace Plugin or any other way to run command line curl API statements?
4) Creating or using a third party HTTPS File Server?
5) Any other suggestions would be greatly appreciated?
Jonathan. (IT Support).
I suppose I don't exactly understand your setup. You say you have a 'Select2' Dropdown Picker created by a Confluence ScriptRunner Macro, which gets the JSON Metadata from a Confluence ScriptRunner Rest API (which is a External MS SQL Stored Procedure). What exactly is contained in the JSON Metadata? It sounds like it returns the file name / file extension, and nothing else. Separately, you have a local Windows Server with thousands of files? From Microsoft's documentation, they says: "Enterprises typically keep data in the file system, while storing the related metadata for the files in a relational database." -- This sounds like your scenario.
I am definitely not an expert on databases, but is it possible for you to store more than just the metadata? Perhaps you could store the files as base64 in the database and then return that along with the JSON metadata? Then, you could simply decode the files & use Confluence's attachment API to upload the files. This may not be possible for you to the size constraints required to store that information, but I'm just trying to think of ideas. :)
Thank you for your reply.
It is not possible, to add a blob to the database, as it is a third party solution.
You are absolutely correct the metadata in the SQL database is parsed in JSON Format:
The windows files are stored on a protected directory.
Using another Confluence SR Rest Endpoint with a SQL Stored Proc call: I will investigate your idea of a SQL Stored Procedure streaming a selected file and see what I can do with that.
Go “behind the screen” to meet some of the Confluence Cloud team. In this video series, we tackle some of the hard-hitting questions you never knew you wanted the answer to! Meet some of the ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events