Confluence HTML Page URL. Viewing Files from a local file server?

IT Support January 4, 2021

Confluence HTML Page URL. Viewing Files from a local file server?

Please can someone help?

Requirement:

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?

  • Potentially using Confluence Scriptrunner Macro(API, Groovy Script / JQuery)?
  • Adding the source file as a Confluence Attachment?
  • Interface with Atlassian Companion to view the source file?

Any other suggestion to meet this requirement would be greatly appreciated?

 

2 answers

0 votes
Joshua Yamdogo @ Adaptavist
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.
January 7, 2021

Hi Jonathan,

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. :)

Regards,

Josh

IT Support January 8, 2021

Hi Joshua

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:

  • Filename
  • Extname
  • File Description
  • Version etc.

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.   

Many Thanks

Jonathan.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 7, 2021

Not directly.

You would have to write something that can read the files from their current storage, and copy them up to a Confluence page to serve them to the users.

IT Support January 7, 2021

Hi Nic

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?

Kind Regards

Jonathan. (IT Support). 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events