cancel
Showing results for 
Search instead for 
Did you mean: 

Create Form Template - Add Upload Button

ihs
Champ in-the-making
Champ in-the-making
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 😛
2 REPLIES 2

predragp
Champ in-the-making
Champ in-the-making
I want the same thing Smiley Happy. Did you have any progress with that?

all best

dranakan
Champ on-the-rise
Champ on-the-rise
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…