{"id":496,"date":"2009-09-17T19:23:04","date_gmt":"2009-09-17T22:23:04","guid":{"rendered":"http:\/\/wordpress.matbra.com\/?p=496"},"modified":"2010-08-03T18:04:35","modified_gmt":"2010-08-03T21:04:35","slug":"enviar-arquivos-via-xml-rpc-em-java","status":"publish","type":"post","link":"https:\/\/wordpress.matbra.com\/en\/2009\/09\/17\/enviar-arquivos-via-xml-rpc-em-java\/","title":{"rendered":"Send files using XML-RPC in Java"},"content":{"rendered":"<p>Hello<\/p>\n<p>Tooday Jorge send me an e-mail asking how to send files using XML-RPC. So I did some modifications in <a href=\"http:\/\/wordpress.matbra.com\/en\/2009\/05\/16\/cliente-e-servidor-java-xml-rpc\/\">Client and Server, Java XML-RPC<\/a> to do this. <\/p>\n<p>I implemented this and it wasn&#8217;t so hard. I read the documentation of <a href=\"http:\/\/ws.apache.org\/xmlrpc\/types.html\" target=\"_blank\">Apache XML-RPC<\/a> to see how to send bytes. They are send using an array of bytes (byte[]) in a Base64 codification. <\/p>\n<p>To create the Base64 codification I used <a href=\"http:\/\/iharder.net\/current\/java\/base64\/\" target=\"_blank\">Java Base64 in public domain<\/a>.<\/p>\n<p><a href=\"http:\/\/www.java-tips.org\/java-se-tips\/java.io\/reading-a-file-into-a-byte-array.html\" target=\"_blank\">How to get an array of bytes from a file<\/a><\/p>\n<p><a href=\"http:\/\/www.velocityreviews.com\/forums\/t388750-write-byte-to-file.html\" target=\"_blank\">How to create a file from a array of bytes<\/a><\/p>\n<p><a href='http:\/\/wordpress.matbra.com\/2009\/09\/17\/enviar-arquivos-via-xml-rpc-em-java\/xml-rpc-transferencia-de-arquivo\/' rel='attachment wp-att-497'>XML-RPC-Transfer-file<\/a><\/p>\n<p>Matheus<\/p>\n<p>PS: This is just an example, any file that client ask, the server will send. It WILL BE A SYSTEM VULNERABILITY!<\/p>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Hello Tooday Jorge send me an e-mail asking how to send files using XML-RPC. So I did some modifications in Client and Server, Java XML-RPC&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/wordpress.matbra.com\/en\/2009\/09\/17\/enviar-arquivos-via-xml-rpc-em-java\/\">Continue reading<span class=\"screen-reader-text\">Send files using XML-RPC in Java<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7,47],"tags":[95,321,94,93],"class_list":["post-496","post","type-post","status-publish","format-standard","hentry","category-aprendendo","category-java","tag-cliente","tag-java","tag-servidor","tag-xmlrpc","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/psjGE-80","_links":{"self":[{"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/posts\/496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/comments?post=496"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/posts\/496\/revisions"}],"predecessor-version":[{"id":782,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/posts\/496\/revisions\/782"}],"wp:attachment":[{"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/media?parent=496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/categories?post=496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.matbra.com\/en\/wp-json\/wp\/v2\/tags?post=496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}