Monday, 22 August 2016

Get to know about how to switch back to flash uploader in Alfresco 5.0.x community versions

While uploading the content in the latest versions of Alfresco, you must have observed that, it always displays the file uploader different than it generally used to show in the earlier versions of Alfresco. Yes, That is correct. In the latest versions of Alfresco, it displays the dnd (drag-and-drop) uploader instead of the flash uploader in the earlier version.  Let me help you with the visuals so that it would be easy for you to understand what I am talking about, if you are new to Alfresco.
Following is the dnd uploader which you will find as the default uploader in latest Alfresco versions.
dnd uploader

Now, following is the flash uploader which used to be default uploader in the earlier versions of Alfresco.

Now, what if you want to switch back to flash uploader as default? Here, I would be sharing my understanding, if you want explicitly switch back to flash upload then how you can do that in the latest 5.0.x Alfresco versions.

Kindly take a note that, flash uploader seemed to be deliberately changed from being the default uploader in Alfresco share as a part of Tomcat 7 security fixes. Hence, if you still want to make flash uploader as the default uploader for the newer versions of Alfresco as a part of your Alfresco implementation then you should take the above point into consideration before finalizing your decision.

Now, let's take a look how we can switch back to flash uploader in 5.0.x Alfresco Community versions.

1. In file-upload.js at the location tomcat\webapps\share\components\upload inside your Alfresco installed directory, the order is explicitly specified as dnd uploader, flash uploader and simple html uploader inside show: function FU_show(config)function using if-else conditions. Modify it to change the order as following.
              var uploadType;
      if (this.hasRequiredFlashPlayer)
         uploadType = this.options.flashUploader;
      } else if (this.browserSupportsHTML5)
         uploadType = this.options.dndUploader;
      } else
         uploadType = this.options.htmlUploader;
Also, make sure that the corresponding minified js is also updated with this change.
2. Also, modify context.xml file, located at tomcat\conf inside your alfresco installed directory.
            <Context useHttpOnly="false"
3. Restart alfresco server and test the file upload now. It should now show the flash uploader back if your browser has flash plugin installed. If it still shows the dnd upload, you may try clearing out browser cache and test again.
I hope this quick information will help you out if you are stretching your head to find out where has flash upload gone and how to get it back. Hope it helps.

No comments:

Post a Comment