thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Srinivasan Anand <>
Subject File Uploads in Thrift with Ruby
Date Mon, 18 Jul 2011 12:30:02 GMT

I am a newbie with Apache Thrift. Though I was able to setup a simple
Server/Client message exchange with the help of Thrift in Ruby
(ruby-thrift-0.6.0), I am actually facing some difficulties in setting up
the code for a simple file upload/transfer functionality from the Client to
the Server.

Since there is no File data type accepted by thrift, I actually had read the
file contents with the"file_path",'rb'){|f|} as string and
transported over to the server and then writing to a new file copy. This
worked for txt files. But in the case of PDF, DOC and probably all other
file types, this doesn't work out. I also tried using the base64 encoding
and decoding mechanisms for this, but no luck.

Following some of the posts in the users-mailing list archives, I thought
the TFileTransport or TSimpleFileTransport or TFDTransport should do the
magic. But I am not able to find either of them in the ruby-thrift gem apart
from the Buffered, Framed, HTTPClient, IOStream and MemoryBuffer Transports.
Am I correct in understanding that these TFileTransport or
TSimpleFileTransport or TFDTransport acually help in transfer/upload of the
files in Java/C++ ? or Am I seriously missing something?

Can we actually do a kind of File Upload (not big file, max 10Mb) with the
ruby-thrift gem from the client to the server. If not, can you suggest any
other possible alternatives for doing this?

Some links I had referred to in the archives:


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