Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

POST THE CONTENT OF A FILE TO AN HTTPS WITH POWERBUILDER.

Status
Not open for further replies.

xirore

Programmer
Jun 10, 2013
1
Hello,
Im Trying To post the content of a file to an https url but the response returns me file was empty. The other variables are Ok and the server verifyes it well. My code is this :

OleObject loo_xmlhttp

ls_post_url = "
TRY

loo_xmlhttp = CREATE oleobject
loo_xmlhttp.ConnectToNewObject("Msxml2.XMLHTTP.4.0")



ls_post_variables += '&email=x@xxxx.com'
ls_post_variables += '&sid=1111111111'
ls_post_variables+='&file=c:\prove.txt value="x@xxxx.com"'
ls_post_variables +='&delim=C'
ls_post_variables +='&field=EMAIL::UPDATE'


loo_xmlhttp.Open ("POST",ls_post_url, FALSE)

ls_FileName = "c:\pruebagarden2.txt"
//loo_xmlhttp.Open ("PUT",ls_Filename, FALSE)
loo_xmlhttp.setRequestHeader("ENCTYPE", "multipart/form-data;")
loo_xmlhttp.send(ls_post_variables)


// Response of the server.

ls_TextoStatus = loo_xmlhttp.StatusText
ll_CodigoStatus = loo_xmlhttp.Status

IF ll_CodigoStatus < 300 THEN

ls_TextoRespuesta = loo_xmlhttp.ResponseText
ll_Respuesta = 0

ELSE

ll_Respuesta = -1

END IF

// Disconnect

loo_xmlhttp.DisconnectObject()

CATCH (RuntimeError rte)

MessageBox("Error", "RuntimeError - " + rte.getMessage())

END TRY
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top