INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

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

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

(OP)
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 = "https://xxx.com/cgi-bin/api/load1"

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close