Get Base 64 Encoding of File Object
===

I have been on a mission the last few days, and the small part of that which is causing me to stumble is that I need to get the base64 encoding of a local binary file. I can ready the file (below), but I'm not sure if there are any methods, etc for getting the base64 encoding of the file now that I 'have' the file.

Any thoughts? I am a total noob when it comes to this :/ I've seen a few examples but non have worked for me and they seem overly complicated for this.

Restrictions: Must be client side! Must be IE 8 compatible.


    <!doctype html>
<html>
    <body>

    <script type="text/javascript">
    function getsize()
    {
        var myObject, afile, size;
        myObject = new ActiveXObject("Scripting.FileSystemObject");
        afile = myObject.GetFile("C:\\Documents and Settings\\houckd\\My Documents\\multiple-file-upload\\jquery.js")
        size = afile.Size;
        alert("The size of the file is:" + size);
    }
    
    </script>
    Get the size for the file "test.txt"
    <form name="myForm">
    <input type="Button" value="Get Size" onClick='getsize()'>
    </form>
    </body>
    </html> 
