Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
jneyens  
#1 Posted : Monday, May 7, 2012 5:54:41 AM(UTC)
jneyens

Rank: Member

Groups: Member
Joined: 7/12/2007(UTC)
Posts: 8

Thanks: 2 times
In a previous version of the ImageUploader we could do something like this:

Code:

<script type="text/javascript">
    var iu = new ImageUploaderWriter('ImageUploader', 650, 450);
    
    iu.activeXControlEnabled = true;
    iu.javaAppletEnabled = true;
    
    iu.activeXControlCodeBase = 'ImageUploader6.cab';
    iu.javaAppletCodeBase = './';
    
    if (iu.getControlType() == "ActiveX")
    {
        alert(iu.getActiveXInstalled());
    }
    else
    {
        alert(iu.getJREInstalled());
    }
    
    iu.writeHtml();
</script>


We are now using ImageUploader 7.0.37 (the ASP.NET Control) like this:

Code:
<Aurigma:Uploader runat="server" ID="imageUploader" Width="927" Height="544"></Aurigma:Uploader>


I know we can access the ImageUploader like this:

Code:

<script type="text/javascript">
    var uploader = $au.uploader('imageUploader');
</script>


Is there a way we can check which version (ActiveX or Java) is being used and whether or not it is installed?
Dmitry.Obukhov  
#2 Posted : Monday, May 7, 2012 10:39:31 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Member
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Kristof,

Unfortunately getActiveXInstalled and getJREInstalled properties were eliminated in Image Uploader v7. You can add this JavaScript methods to your code to achieve your requirements:

getActiveXInstalled():
Code:
<script type="text/javascript">
function  getActiveXInstalled () {
  /// <summary>Verifies whether ActiveX control is installed. If yes, it returns true; otherwise it returns false.</summary>
  /// <returns type="Boolean" />
  var progId = $au.uploader("imageUploader").activeXControl().progId();
  if (progId) {
    try {
      var a = new ActiveXObject(progId);
      return true;
    }
    catch (e) {
      return false;
    }
  }
  return false;
}
</script>

Then you can call this method to get whether ActiveX control is installed:
Code:

Then call this method like in this string:
var testvalue_1 = getActiveXInstalled();
alert(testvalue_1); //returns true or false

To detect whether Java is installed, you can implement this method:

getJREInstalled():
Code:

// -2 - Java not installed or not enabled
    // -1 - Installed Java version is less than required
    //  0 - Unable determine java
    //  1 - Required java version available
    function getJREInstalled () {
        var result = -2;
        if (navigator.javaEnabled()) {
            var ver = IUCommon.javaDetector.getJREs();
            if (ver == null) {
                //we can't get information about java in this browser
                result = 0;
            } else if (ver.length > 0) {
                //java installed and we have its version
                result = -1;
                for (var i = 0, maxi = ver.length; i < maxi; i++) {
                    if (IUCommon.javaDetector.compareVersions(ver[i], this.javaVersionRequired)) {
                        result = 1;
                        break;
                    }
                }
            }
        }
        return result;
    }

If you have any additional questions please let me know.

Edited by user Monday, May 7, 2012 10:40:14 PM(UTC)  | Reason: Not specified

Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.