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

Sid Sethi June 10, 2014

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

0 votes
Answer accepted
Sid Sethi July 16, 2014

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
TAGS
AUG Leaders

Atlassian Community Events