Home

Create Form Template - Add Upload Button

You are here

4 posts / 0 new
Last post
Create Form Template - Add Upload Button

Hello,

I need to add a upload button in a custom create-form template. This form is used for create a new data-list item, and I need to upload one or more files that are associated with this item. I know that I can config a custom control template for each property (or association), for example, the association control template (association.ftl) allows you to choose a file from the repository, but I need to UPLOAD a new file from my pc and then these files will be associated with the item (for example, by a custom form processor, when the item is persisted). In conclusion, my problem is that I don't know how to create a button with the upload function in my create form. Any help?

thanks :-p

Re: Create Form Template - Add Upload Button

I want the same thing :). Did you have any progress with that?

all best

Re: Create Form Template - Add Upload Button

Hello,

Need the same thing in a workflow : https://forums.alfresco.com/en/viewtopic.php?f=34&t=42140

Actually I am looking in files : WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/documentlibrary/include/toolbar.lib.ftl
I define a field to use ftl (in share-config-custom.xml)

<field id="sgfwf:libelle4" set="other" >
<control template="/org/alfresco/components/form/controls/fileupload.ftl" >
</control>
</field>

fileupload.ftl

<!-- HTML Upload -->
<script type="text/javascript" src="/share/res/components/upload/html-upload-min.js"></script>
 
<style type="text/css" media="screen">
@import "/share/res/components/upload/html-upload.css";
</style>
<!-- Flash-Upload -->
<script type="text/javascript" src="/share/res/components/upload/flash-upload-min.js"></script>
<style type="text/css" media="screen">
@import "/share/res/components/upload/flash-upload.css";
</style>
<!-- File-Upload -->
<script type="text/javascript" src="/share/res/components/upload/file-upload-min.js"></script>
<!-- DND-Upload -->
<script type="text/javascript" src="/share/res/components/upload/dnd-upload-min.js"></script>
 
<style type="text/css" media="screen">
@import "/share/res/components/upload/dnd-upload.css";
</style>
 
<div class="hideable toolbar-hidden DocListTree">
<div class="file-upload">
<span id="${fieldHtmlId}-fileUpload-button" class="yui-button yui-push-button">
<span class="first-child">
<button name="fileUpload">${msg("button.upload")}</button>
</span>
</span>
</div>
</div>

The button is displayed but don't open the select file...

But it's not working for the moment... I am working on it...

If you have best pratices or find good documentation to do a feature, add a link here : http://wiki.alfresco.com/wiki/How_to

Re: Create Form Template - Add Upload Button

Somebody found a solution?