JavaScript - Data conversion ( binary to base64)

Posted on 2003-03-19
Medium Priority
Last Modified: 2008-02-01
Hi there
I tried to upload a file (which can be any file eg: doc, pdf, gif, etc) using ActiveXObject.

// files upload function
function GetFile()
        aStream = new ActiveXObject("ADODB.Stream");
        aStream .Type = 1;  // 1=adTypeBinary
     aStream .Open();
     aStream .LoadFromFile("c:\\temp\\test.doc");

      var s = ado_stream.Read(-1); // -1=adReadAll
   what I get here is a binary contenet of the file which I want to convert it to base64!
   how can I convert this binary data to base64?
Would you hlep me out?



Question by:Cyrus2k
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 28

Expert Comment

ID: 8172709
LVL 28

Accepted Solution

sybe earned 450 total points
ID: 8172720

Author Comment

ID: 8177811
Thanks a lot for your help

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question