?
Solved

JavaScript - Data conversion ( binary to base64)

Posted on 2003-03-19
3
Medium Priority
?
1,240 Views
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.

Example:
<SCRIPT LANGUAGE=JavaScript>
// 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?

Cheers

   

0
Comment
Question by:Cyrus2k
  • 2
3 Comments
 
LVL 28

Expert Comment

by:sybe
ID: 8172709
0
 
LVL 28

Accepted Solution

by:
sybe earned 450 total points
ID: 8172720
0
 
LVL 1

Author Comment

by:Cyrus2k
ID: 8177811
Thanks a lot for your help
0

Featured Post

Technology Partners: 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

Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
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
Course of the Month9 days, 13 hours left to enroll

612 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