cURL / Mailing Lists / curl-library / Single Mail

curl-library

Problem by using libCurl

From: Vincent <le.zvince_at_gmail.com>
Date: Tue, 9 Mar 2010 14:03:28 +0100

Hello,

In the tutorial I have been found an exemple How to upload a file on a FTP
server :

I try to do the same with Windev but it doesn't work :
_______________________________________________________________________________________________________________
*NEasyhandle est un entier
strCheminFic est une chaîne
strNomFic est une chaîne

strNomFic = "upload.txt"
strCheminFic = "C:\WINXP\Profiles\25099819\Desktop\libcurl\";

NEasyhandle = AppelDLL32(fRepExe()+"\libcurl","curl_easy_init")

SI NEasyhandle = 0 ALORS
    Erreur(ErreurInfo())
SINON
    iReturn est un entier sans signe
    iErreur est un entier

    iErreur = AppelDLL32("libcurl", "curl_easy_setopt", NEasyhandle,
CURLOPT_URL, "ftp://vince:password@127.0.0.1/" + strNomFic)
    lblInfo = lblInfo + "CURLOPT_URL = " + iErreur + RC

    iErreur = AppelDLL32("libcurl", "curl_easy_setopt", NEasyhandle,
CURLOPT_UPLOAD, "1")
    lblInfo = lblInfo + "CURLOPT_UPLOAD = " + iErreur + RC

    iFichier est un entier
    iFichier = fOuvre(strCheminFic + strNomFic, foLecture )
    lblInfo = lblInfo + "Pointeur fichier : " + &iFichier + " - "
+fTaille(strCheminFic + strNomFic) + " Octets" + RC

    iErreur = AppelDLL32("libcurl", "curl_easy_setopt", NEasyhandle,
CURLOPT_INFILE, iFichier )
    lblInfo = lblInfo + "CURLOPT_INFILE = " + iErreur + RC

    iErreur = AppelDLL32("libcurl", "curl_easy_setopt", NEasyhandle,
CURLOPT_INFILESIZE, fTaille(strCheminFic + strNomFic) )
    lblInfo = lblInfo + "CURLOPT_INFILESIZE = " + iErreur + RC

    //------------------------- TRANSFERT ------------------------
    iErreur = AppelDLL32("libcurl", "curl_easy_perform",NEasyhandle)
    lblInfo = lblInfo + "curl_easy_perform = " + iErreur + RC
    //------------------------------------------------------------

    fFerme(iFichier)

    AppelDLL32("libcurl", "curl_easy_cleanup",NEasyhandle)//fermeture de la
session curl

    DéchargeDLL(NEasyhandle)

FIN
*
_______________________________________________________________________________________________________________

PLEASE HELP ME !!!*

*Thanks per advance

Vince
*
*

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-03-09