cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Using ftpupload.c returns a directory listing in HTML format

From: Patrick Monnerat <Patrick.Monnerat_at_datasphere.ch>
Date: Thu, 13 Aug 2015 19:52:04 +0200

 
Nils Söderman wrote:
> My wish is to make a file, with time of day and a count, when my powermeter signals a 1/10 kWh have been used. The RaspberryPi controlling the meter send the result ( only 31 bytes) to the archive, using FTP, asking it to append the file to the file containing all the earlier results. I can then get the collected result and compare with the data from my weather-station.
I have tried to use the append function in the FTP server in the archive to do what was wonted. I also made a new share in the archive, named WS_DATA. It has the password WS_DATA1. I also tried to tell the cURL my folder and password on the archive.
So am I using the APPE and password input correct, I wonder...

Your explanation is really application-oriented and, I'm afraid, I don't understand what you mean.

However, from your attached program, I see you misinterpreted the APPE function: this is intended to append while uploading, not to concatenate files afterwards.

In addition, this is conceptually not compatible with your "rename" feature. Either you upload a new data set to a "hidden" file (to avoid the target sees it before complete) then rename it to unhide, effectively erasing the previous file. Or you update the visible file that contains the previous data. You cannot do both in a simple way with FTP.

Please look at http://curl.haxx.se/libcurl/c/CURLOPT_APPEND.html: this is the way cURL implements the append function (it is issued BEFORE the upload).

... And remember: FTP is very old and there's no magic in it ;-)

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-08-13