qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carl Trieloff <cctriel...@redhat.com>
Subject Re: How to transfer a document like xml or txt using qpidclient?
Date Mon, 20 Jul 2009 18:02:32 GMT


If you want to contribute your file transfer utility to the project as a
packaged example,
that would be a great use case to have in the shipped examples or utilities.


John Dennis wrote:
> On 07/15/2009 08:59 PM, aguestrush wrote:
>> I want to write a client to transfer some files such as .xml to another client,there
is a example but I want a example which have a function that if I use the name of the file
as one parameter of the function,the file will be transfered.How can I use the client API
to implement this problem.
> I have code that does file transfers, however I get the feeling it's
> more than you might want/need. It's designed for Linux systems and
> transfers all the metadata associated with a file as well as the file
> contents (e.g. ownership, permissions, extended attributes, etc.). It
> also is capable of transferring large files in chunks and compressing
> the file contents prior to transmission and then uncompressing it upon
> receipt. I can share the code if there is interest, but like I said I it
> may be way more than you need.
> If all you want to do is transfer a simple file of reasonable size then
> it's trivial with AMQP.
> On the sending side:
> 1) Add the filename to the application headers in the message.
> 2) Open the file, read it's contents into a string, set the string as
> the message.
> On the receive side:
> 1) Get the filename from the application headers
> 2) Open the file for writing and write the message.
> Each side is about 5 lines of C++ code.
> How to do C++ file IO is left as an exercise for the reader :-)

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message