mercredi 4 novembre 2015

file upload in adobe cq

I need to write a component that does file upload (restrict the upload file types to PDF only).

I have seen CQ has its own dialogs to upload files, but I am not sure, whether I could resuse them.

Please let me know, if I could use out of the box xtypes "smartfile", "fileuploadfield", "html5fileuploadfield", or "uploaddialogbutton" with restriction to PDF files.

OR Do I need to write custom component extending one of the xtypes?

I appreciate all the help.

EDIT

<div id='fi-form'></div>
<script>
  CQ.Ext.onReady( function(){


var card = new CQ.Ext.Panel({
    renderTo: 'fi-form',
    title: 'Example Wizard',
    layout:'card',
    activeItem: 0, // make sure the active item is set on the container config!
    bodyStyle: 'padding:15px',
    defaults: {
        // applied to each contained panel
        border:false
    },
    // the panels (or "cards") within the layout
    items: [{
        id: 'card-0',
        xtype: 'fileuploadfield',
        emptyText: 'Select a PDF',
        fieldLabel: 'Photo',
        name: 'photo-path'

    },{
        id: 'card-1',
        html: '<p>Step 2 of 3</p>'
    },{
        id: 'card-2',
        html: '<h1>Congratulations!</h1><p>Step 3 of 3 - Complete</p>'
    }]
});






  });

</script>

The following is the output

enter image description here

Could some one please tell me the what is this "Browse" button there ?

Thank you, Sri

Aucun commentaire:

Enregistrer un commentaire