creating tar file and streaming it over HTTP?
peter.bienstman at gmail.com
Wed Jan 6 13:26:02 CET 2010
I would like to bundle up a number of files in a tar file and send it
over a HTTP connection, but I would like to do this without creating
the tar file on disk first.
I know I can get tarfile to output to a stream by doing something like
tar_pipe = tarfile.open(mode="w|", fileobj=my_file_obj)
However, I can't figure out which file object to use to send this over
a HTTP connection.
conn = httplib.HTTPConnection(hostname, port)
tar_pipe = tarfile.open(mode="w|", fileobj=conn.sock.makefile())
for filename in filenames:
but that does not send any data...
More information about the Python-list