curl-and-python

Re: Upload string (and not file) to FTP server...

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 11 Feb 2010 08:44:36 +0100 (CET)

On Wed, 10 Feb 2010, Christian Malmquist wrote:

> Just started scripting a small app that will send some info from a maemo
> phone to my ftp server at regular intervals. Using pycurl for the job, but
> have not yet been able to pass a string across instead of a file.

Use the read callback!

> c.setopt(c.WRITEDATA, string_to_upload)

Note that WRITEDATA is data passed to the _write_ callback. The callbacks are
seen from curl's view, so writing is when it downloads data and reading is for
getting data for uploading.

-- 
  / daniel.haxx.se
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2010-02-11