SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Image size in javascript

    hi,
    I want to find the size of jpg image in javascript i have done using activeXobject but it is not working on mozilla it only works on IE.
    the code is this:

    <html>
    <head>
    <script language="JavaScript">
    function A()
    {
    var oas = new ActiveXObject("Scripting.FileSystemObject");

    var d = document.form1.fsize.value;
    var e = oas.GetFile("c:\\test.jpg");

    var f = e.size;
    alert(f + " bytes");
    }
    </script>
    </head>
    <body>
    <form name="form1">
    <input type="file" name="fsize">
    <input type="button" name="c" value="SIZE" onClick="A();">
    </form>
    </body>
    </html>


    any body can help me without using this.

    thanks.

  2. #2
    SitePoint Evangelist
    Join Date
    Jul 2007
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ActiveXObjects are only supported by IE

  3. #3
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Image File size

    Quote Originally Posted by r51 View Post
    ActiveXObjects are only supported by IE
    Thanks, but i want the method that how can i do this in other explorers.
    i only want the jpeg image file size which support by all the browsers.

    thanks in advance


Bookmarks

Posting Permissions

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