Loading ...

Uploading a file | Communifire Support

Communifire Support

Leave Space :

Are you sure you want to leave this space?

Join this space:

Join this space?

Add a new tab

Add a hyperlink to the space navigation. You can link to internal or external web pages. Enter the Tab name and Tab URL. Upload or choose an icon. Then click Save.

The name that will appear in the space navigation.
The url can point to an internal or external web page.
Login to follow, share, and participate in this space.
Don’t have a support community login?Create your account now
Posted in: Features and Functionality

Uploading a file

Subscribe to RSS
  • cbunts

    Hi,

    I am looking to create a button on a page builder page that will automatically select the folder I am trying to place a file into and activating the green upload button to go to the Select File dialog box.  The reason I am trying to do this is to eliminate the possibility of loading files into the wrong folder.  Some of users are a little careless and put files directly into the Root.

    I am able to do the first part through coping the URL from the folder but not sure how to get to the file upload button to activate in the same action.

    Thanks for the help

     

     

  • gskamau
    Answered

    Hey Chris,

    Edit the button widget and add &openUpload=true to the end of the URL. Then go to Control Panel > System > General Settings > Header and Footer Scripts , and add the following code in Footer Scripts.

    <script>
    window.onload = function() {
       if(window.location.href.includes('directoryID')) {
          var params = window.location.search.split('&');
          var i = 0;
          for(i = 0; i < params.length; i++) {
             if(params[i].includes("openUpload")) {
                if(params[i].split('=')[1] == "true") {
    	       $("*[id$=FileControl1_hypUploadfiles").click();
                    break;
                }
       	 }  
          }
       }
    }
    </script>

    Then click Save System Settings at the bottom. Now when you click the button, &openUpload=true should be part of the URL, and the upload modal should open.

    Grace

  • cbunts

    Perfect.  Thanks for the help

Page 1 of 1 (3 items)