Forums

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

How to store a BLOB and authenticate users to download it?

Arın Mirza October 18, 2018

I am writing a simple plugin that generates a special purpose Powerpoint presentation from an existing Confluence page.

The file needs to be (1) generated upon the user clicking a button, (2) stored somewhere temporarily and (3) be offered to the (authenticated) user to download by an "open/dowload file" prompt.

generate-pptx.pngopen-download-prompt.png

The user interface part (1) is working as expected, but I am stuck in (2)nd and (3)rd part. Currently I am storing the file in the local plugin directory by most basic means:

File file = new File("export.pptx");
// ... Open stream, write to file and close stream

But I am aware that this is far from being the best practice. Where should I store these generated files instead? How can I authenticate the user who clicked the button to access this file, get a Uniform Resource Identifier belonging to the file so that I can redirect the user to this address and pop up the "open/download file" prompt?

By examining other plugins, I've concluded that I am probably going to need to use the GateKeeper interface, but there are unfortunately no tutorials about using it. Therefore, a most basic functional code example would be highly appreciated.

If anyone is interested, I've reopened this question at https://community.developer.atlassian.com/t/how-to-store-a-blob-and-authenticate-users-to-download-it/24577

 

1 answer

0 votes
Thomas Schlegel
Community Champion
October 18, 2018

Hi  @Arın Mirza,

do you know the Atlassian Developer Community:

https://community.developer.atlassian.com/

Maybe you find an answer for your question there.

Arın Mirza October 18, 2018

I am totally in wrong part of the website, thank you for the notice.

Edit: Is there a proper way to delete this question or inform the moderators to do so?

Edit 2: Please see https://community.developer.atlassian.com/t/how-to-store-a-blob-and-authenticate-users-to-download-it/24577

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events