AnsweredAssumed Answered

Uploadbutton on a custom page

Question asked by tb13 on Dec 8, 2010
Latest reply on Jan 14, 2015 by sanketgosavi
hi I would like to implement an upload button on a custom page.

I have reverse engineered a lot, and I have a button on that page however it does not pop up the upload dialogue.

Is there anywhere a tutorial or anything that I could use to accomplish this?

On my YUI controller I have following …

this.fileUpload seems to be empty as I get the message twice in the js error console.


  /**
        * File Upload button click handler
        *
        * @method onFileUpload
        * @param e {object} DomEvent
        * @param p_obj {object} Object passed back from addListener method
        */
       onFileUpload: function NewDoc_onFileUpload(e, p_obj)
       {
        Alfresco.logger.debug("Empty");  
        if (this.fileUpload == null)
        {
           Alfresco.logger.debug("Empty");
           this.fileUpload = Alfresco.getFileUploadInstance();
            
        }

          // Show uploader for multiple files
          var multiUploadConfig =
          {
             siteId: siteId,
             containerId: "documentLibrary",
             uploadDirectory: "MyFolder",
             filter: [],
            // mode: this.fileUpload.MODE_MULTI_UPLOAD,
             thumbnails: "doclib",
             onFileUploadComplete:
             {
                fn: this.onFileUploadComplete,
                scope: this
             }
          };
          this.fileUpload.show(multiUploadConfig);
       }

however it does not seem to get me a new instance with: this.fileUpload = Alfresco.getFileUploadInstance();   and  this.fileUpload.show(multiUploadConfig); does not seem to work… any ideas?

Outcomes