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

Hi,

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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

685 views 21 12
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