cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: State of things for release?

From: Tiago Conceição <tiago_caza_at_hotmail.com>
Date: Wed, 30 Jul 2008 18:31:35 +0000

> On Wed, Jul 30, 2008 at 04:33:09PM +0000, Tiago Conceição wrote:
> > I have tryed many things but no work :(
> > also i have tryed with 2 connections (call ftpExist and ftpUpload function)
> > I just dont know how to make it in 1 connection and 2 request, im new with
> > libcurl
> > anyone can post a sample how to do it?
>
> Simply put, do a complete ftp transaction with CURLOPT_NOBODY set to 1 to
> check the existence of the file, check the error code, then do a new one
> (with the same handle) with CURLOPT_NOBODY set to 0 to actually transfer
> the file.
>
> >>> Dan
> --
> http://www.MoveAnnouncer.com The web change of address service
> Let webmasters know that your web site has moved

yes i try that in my first trys but always return CURLE_OK if file exists or not

my code:

int ToolsSystem::FTPFileExists(const char *host, const char *file, int timeout){ CURL *curl; CURLcode res = CURLE_GOT_NOTHING; curl = curl_easy_init(); if(!curl) return CURLE_GOT_NOTHING; curl_easy_setopt(curl,CURLOPT_URL, UTILSNAMESPACE::StrFormat("%s/%s", host, file)); curl_easy_setopt(curl,CURLOPT_NOBODY, 1L); if(timeout > 0) curl_easy_setopt(curl, CURLOPT_FTP_RESPONSE_TIMEOUT, timeout); //curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); res = curl_easy_perform(curl); curl_easy_cleanup(curl); return res;}

_________________________________________________________________
Receba GRÁTIS as mensagens do Messenger no seu celular quando você estiver offline. Conheça o MSN Mobile!
http://mobile.live.com/signup/signup2.aspx?lc=pt-br
Received on 2008-07-30