Results 1 to 3 of 3

Thread: Upload files from local disk to briefcase from Zimlet

  1. #1
    Join Date
    Aug 2010
    Rep Power

    Default Upload files from local disk to briefcase from Zimlet

    I am trying to write a Zimlet that should work with briefcase - I need to upload files and rename them according to certain naming convention. It should be very simple, but I really can't get it.

    I have already tried even to look into ZmUploadDialog.js source and copy-paste functions from there but it gives me an error
    guids is undefined

    com_itdassist_register_inbound_HandlerObject.prototype._uploadSaveDocs =
    function(files, status, guids) {
        guids = guids.split(",");
    As far as I understand, guids should be returned by uploadMgr.execute after
        var callback = new AjxCallback(this, this._uploadSaveDocs, [files]);
        var uploadForm = document.getElementById("registerInbound_form");
        var uploadMgr = appCtxt.getUploadManager();
        window._uploadManager = uploadMgr;
        try {
            uploadMgr.execute(callback, uploadForm);
    But it does not work for me.

    Could anybody be so kind and point me to the right way either:
    (a) what is wrong with my implementation taken from ZmUploadDialog?
    (b) what is the simpliest way to just upload file from local disk to briefcase and rename it?

  2. #2
    Join Date
    Apr 2011
    Rep Power

    Post Uploading files from Zimlet

    If you want to call the uploading file dialog you have to do the following:

    // Get the id of folder where you want to upload your file
    var folderId = ZmOrganizer.ID_BRIEFCASE;

    // Setting up callback for new file creation (will be called if file is successfuly uploaded)
    this._insertObjectsCallback = new AjxCallback(this,this._insertObjects);

    // Check access permissions for selected folder
    if(this._chkFolderPermission(folderId)) {

    // Getting folder by ID
    var cFolder = appCtxt.getById(folderId);

    // Get upload dialog for selected folder with defined callback and popup it
    appCtxt.getUploadDialog().popup(cFolder, this._insertObjectsCallback, "Upload new file");
    Call back function should be defined as following:

    your_zimlet_name.prototype._insertObjects =
    function(func, folder, filenames, files) {
    // Some actions

    This method was grabed from ZImbra source. All this functions are not listed in API reference. Actually "getUploadDialog()" is in the reference, but there are no "popup()" function with describing of input parameters.

    I also have question for others: is it possible to upload file in a different folder (not in standard briefcase). I need file to be in shared folder and I know only the name of this folder, not it's ID?

  3. #3
    Join Date
    Jun 2011
    Rep Power


    Can one of you please share the complete zimlet code? I am trying to achieve some thing similar and any reference could be of great assistance..

Similar Threads

  1. Daily mail report always reports "No messages found"
    By McPringle in forum Installation
    Replies: 42
    Last Post: 06-13-2011, 08:57 AM
  2. Replies: 6
    Last Post: 03-05-2010, 12:13 AM
  3. Replies: 21
    Last Post: 02-04-2010, 09:06 AM
  4. Samba and POSIX undeploy problem
    By catnipper in forum Zimlets
    Replies: 0
    Last Post: 09-02-2009, 10:51 AM
  5. Zimbra fails after working for 2 weeks
    By Linsys in forum Administrators
    Replies: 10
    Last Post: 10-07-2008, 12:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts