Sending a file via XML RPC

Hi all,

I’m trying to send a file via XML RPC … the below code doesn’t
work (some HTTP error) and I cant find any samples anywhere on Google
… can someone shed some light?

@server = XMLRPC::Client.new2(“http://” + @loginName.to_s + “:” +
@password.to_s + “@” + SITE_URL + “/”)
file = IO.read(“files/something.txt”)
result = @server.call(“submitFile”, “first parameter” , “yada yada”,
file )

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

e deleflie wrote:
| Hi all,
|
| I’m trying to send a file via XML RPC … the below code doesn’t
| work (some HTTP error) and I cant find any samples anywhere on Google
| … can someone shed some light?

And what would that error be?


Phillip G.
Twitter: twitter.com/cynicalryan

~ - You know you’ve been hacking too long when…
…in a dream, you are walking down a path (using PostScript’s
pathforall)
and get woken up by a closepath.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkf5WEMACgkQbtAgaoJTgL8EtACfWXdfd1Wn4Cch1nZreqedNHny
gB0AniRnWo2BAWEjBo6NgpsnT9xobPT3
=3cbC
-----END PGP SIGNATURE-----

e deleflie wrote:
| Hi all,
|
| I’m trying to send a file via XML RPC … the below code doesn’t
| work (some HTTP error) and I cant find any samples anywhere on Google
| … can someone shed some light?

And what would that error be?

HTTP-Error: 500 Internal Server Error

I suspect that the error is irrelevant, because I have no idea how to
pass a file in an XML RPC request … and the error was generated
from a wild guess (which is the code repeated below).

@server = XMLRPC::Client.new2(“http://” + @loginName.to_s + “:” +
@password.to_s + “@” + SITE_URL + “/”)
file = IO.read(“files/something.txt”)
result = @server.call(“submitFile”, “first parameter” , “yada yada”,
file )

Etienne

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

e deleflie wrote:
|> e deleflie wrote:
|> | Hi all,
|> |
|> | I’m trying to send a file via XML RPC … the below code doesn’t
|> | work (some HTTP error) and I cant find any samples anywhere on Google
|> | … can someone shed some light?
|>
|> And what would that error be?
|
| HTTP-Error: 500 Internal Server Error

This is somewhat of a generic, catch-all error. Usually means that the
server isn’t configured properly, or has troubles connecting to a
database or somesuch thing.

If you have access to the server, you could check its logs.


Phillip G.
Twitter: twitter.com/cynicalryan

Watch out for off-by-one errors.
~ - The Elements of Programming Style (Kernighan & Plaugher)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkf6FBgACgkQbtAgaoJTgL+QEACcDRJ/jXHvw3W69wkcZupgoqDV
CdwAni7uQiwOw1r/peG0dEvJ/SrmDl9m
=n7Nb
-----END PGP SIGNATURE-----

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs