Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Uploading file via HTTP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00819019
Message ID:
00820363
Vues:
13
Arriyel,

The documentation on the httpConnect method in the west-wind help file states not to include the protocol in the host name. Your httpConnect line should look more like:

oHTTP.HTTPConnect("www.aesdirect.gov", "UserName", "PassWord", .T.)

You will then need to use the httpGetEx method to specifiy the page "/aesdirect/system/entry.cgi?p_action=BU" etc....

The reason you are currently getting an error of "server not found" is that your httpConnect code is causing your application to look up https://www.aesdirect.gov/aesdirect/system/entry.cgi?p_action=BU" and not
"www.aesdirect.gov".

regards,

Jim Erwin

>Hi,
>
>I'm working on a project for uploading files via HTTP to a secure site. I'm using xxIPStuff to see if it will do the job but I keep getting a 'The server name or address could not be resolved' error message. I can't give out the User name and pass word but here is the code I am using.
>
>
>*** Sending Files via HTTP from a VFP client
>#INCLUDE WCONNECT.h
>SET PROCEDURE TO wwUtils ADDITIVE
>SET CLASSLIB TO wwIPStuff ADDITIVE
>
>CLEAR
>
>oHTTP = CREATEOBJECT("wwHTTP")
>
>*** Connect to the server
>oHTTP.HTTPConnect("https://www.aesdirect.gov/aesdirect/system/entry.cgi?p_action=BU", "UserName", "PassWord", .T.)
>
>*** Initialize the variables that will be filled by HTTPGetEx
>lcHTML=""     && Data buffer
>lnText=0      && Size of the output to return - 0 means autosize
>
>*** Send the POST data and retrieve HTTP result
>oHTTP.nHTTPPostMode = 2
>oHTTP.AddPostKey("filename", "C:\EXPORTVSS\AES_OUT\UPTEST01.000", .T.)
>lnResult = oHTTP.HTTPGetEx("/aesdirect/system/fup.cgi",@lcHTML,@lnText)
>oHTTP.nHTTPPostMode = 1
>IF lnResult # 0
>   WAIT WINDOW ALLTRIM(STR(lnResult)) + " - " + oHTTP.cErrorMsg NOWAIT
>   RETURN
>ENDIF
>
>? TRIM(lcHTML)
>
>oHTTP.HTTPClose()   && Close the connection
>
>RETURN
>
>
>Any help is greatly appreciated.
>
>Thanks,
>Arriyel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform