XMLRPC::create blog_newMediaObject \
-name "metaWeblog.newMediaObject" \
-proxy $url \
-params { blogid string username string password string file struct }
(the url should be the entry point for all XMLRPC call on the HTTP
remote server).
Use it in the following way later on.
set fileinfo(bits) [encode_file $local_fname]
set fileinfo(name) $remote_fname
if { $type != "" } {
set fileinfo(type) $type
}
::llog::log "Pushing encoded content of \"$local_fname\" to blog" 2
set res [catch [list blog_newMediaObject $blogid $bloguser \
$blogpasswd [array get fileinfo]] answer]
if { $res != 0 } {
::llog::log "Failed posting media object \"$remote_fname\": $answer" 0
} else {
# Do something
>Declare a tcl proc bound to an XMLRPC remote entry using something like
>(extract from some blogging code, I guess you'll understand the
>principle without knowing the details of my own code):
>
> XMLRPC::create blog_newMediaObject \
> -name "metaWeblog.newMediaObject" \
> -proxy $url \
> -params { blogid string username string password string file struct }
>
>(the url should be the entry point for all XMLRPC call on the HTTP
>remote server).
Thanks a lot - didn't know it was this easy :)
Cannot test it right now 'cause the server in question is on a local
net at some other place, but I'm optimistic.
Thanks and have a nice weekend
Helmut Giese