How to attach/upload image in a Wizard of the Confluence Blueprint Plugin?


Is there a sane way to upload an image through the wizard of a blueprint? I want to be able to attach multiple images on the wizard, and on page creation, display the images along side other form content.

I tried to implement the .attachmentsPanel template but haven't been able to configure the file upload. Is there a way to handle file upload on postRender? Like you can handle labels using the name="lablelsString" in the <input> field.

If I put the following code in the form, is there a way to use an Ajax call on postRender to upload the 
selected files?

<div class="upload-field field-group"> <label for="uploadFile">Upload file</label> <input class="upfile" type="file" id="uploadFile" name="uploadFile" title="upload file"> </div>

I'm just stuck on trying to figure out a path to go about this issue. Any help would 
be appreciated.

1 answer

1 accepted

0 votes
Accepted answer

Use AJS postRender for the blueprint wizard page to make an ajax call to a servlet to create a dummypage/space. Get the dummy page/space homepage id, make an ajax rest call to upload image to the dummy page. On BluePrintCreateEvent, copy the attachment from the dummy page/space homepage to the created page/space homepage. Then delete the dummy page/space's homepage within the same EventListener class. Through postRender in the javascript make another ajax call to the servlet to delete the dummy page and its attachments on clicking back or close.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

889 views 45 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you