Search the web
Sign In
New User? Sign Up
jsolait
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Base64 encode file located on local computer   Message List  
Reply | Forward Message #276 of 411 |
Re: Base64 encode file located on local computer

Ah.

Another approach that I am considering is to uploat the file to the a
HTTP server and have that XML-RPC over to the XML-RPC server.

I already have to do a PHP proxy all my XML-RPC calls because Firefox
doesn't allow javascript to communicate with XML-RPC servers located
on the same host BUT different port number. So, passing the file to
the proxy first is another viable solution.

--- In jsolait@yahoogroups.com, "Jan-Klaas Kollhof" <keyjaque@...> wrote:
>
> yes and no,
>
> form within the browser it is not possible as you cannot read local
> files.
> From within windows scripting it should be possible as long as you can
> read the content of the file, which should work fine for text files
> but for binary it would be a bit difficult. Also the base64 encoder is
> not very fast in JS. The best thing would be to take an external
> program that turns your file into base64 encoded file, read the file's
> content into a string store that string inside an object that has a
> toXmlRpc() method which should return the xml-rpc code for base64
> encoded data, i.e. <base64> contentOfYourData </base64>
>
> you can then send the object as a paramert to the xml-rpc service
> like any other object
>
>
> Jan
>
> PS
> this might work as a data class
>
> var Base64Data=Class(function(publ,priv,supr){
>
> publ.__init__=function(data){
> this.data=data;
> }
>
> publ.toXmlRpc=function(){
> return "<base64>"+this.data+"</base64>";
> }
> });
>
>
> to use it just create a new object:
>
> var data = new Base64Data(base64_encoded_data)
> service.handleData(data)
>
>
> PPS: just found a little bug in the xml-rpc module that prevents it
> from receiving base64 encoded data if it is split up on multiple
> lines. though sending works just fine.
>








Tue Sep 26, 2006 7:05 pm

roynos
Offline Offline
Send Email Send Email

Forward
Message #276 of 411 |
Expand Messages Author Sort by Date

Is it possible to base64 encode a file on the local disk of the computer and send it over an XML-RPC using jsolait?...
roynos
Offline Send Email
Sep 25, 2006
9:14 pm

yes and no, form within the browser it is not possible as you cannot read local files. From within windows scripting it should be possible as long as you can ...
Jan-Klaas Kollhof
keyjaque
Offline Send Email
Sep 26, 2006
2:40 pm

Ah. Another approach that I am considering is to uploat the file to the a HTTP server and have that XML-RPC over to the XML-RPC server. I already have to do a...
roynos
Offline Send Email
Sep 26, 2006
7:08 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help