Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

File upload and response with TclCurl
Can I use ::curl::transfer to send a file to a Web Server and get a
response from that Web Server?  For example I have an XML file that I
wish to send to an asp application, i.e, http://10.10.20.11/hisap.asp.
The web server then returns an Acknowledgement message indicating
whether he was happy with the message or not.

Something like: ::curl::transfer -url http://10.10.20.11/hisap.asp
-file myfile

returns 0.  I need the response from the remote application.

On the same subject, do I have to send it as a file or can I send it
as a buffer from within my Tcl script?

Any help is appreciated

Report this thread to moderator Post Follow-up to this message
Old Post
Charlie Bursell
10-20-04 09:07 PM


Re: File upload and response with TclCurl
charlie.bursell@quovadx.com (Charlie Bursell) wrote in message news:<ac45e772.0410200655.39
a42a93@posting.google.com>...
> Can I use ::curl::transfer to send a file to a Web Server and get a
> response from that Web Server?

I am guessing the asp app will expect the file to be sent
as if you had been in a web page with a form and a submit
button, in that case you need to do something like this:


set fileContent "This is what we will send as if it was the content of a fil
e"

curl::transfer -url http://10.10.20.11/hisap.asp -bodyvar ack -post 1
-httppost [list name "name"   bufferName noFile.txt           \
buffer $fileContent contenttype "text/plain"]
-httppost [list name "submit" contents "send"]

puts "Server acknowledgment:"
puts $ack

Report this thread to moderator Post Follow-up to this message
Old Post
Andres Garcia
10-21-04 09:04 PM


Re: File upload and response with TclCurl
fandom@retemail.es (Andres Garcia) wrote in message news:<5d6e9670.0410210446.724ff95@posti
ng.google.com>...
> charlie.bursell@quovadx.com (Charlie Bursell) wrote in message news:<ac45e
772.0410200655.39a42a93@posting.google.com>... 
>
> I am guessing the asp app will expect the file to be sent
> as if you had been in a web page with a form and a submit
> button, in that case you need to do something like this:
>
>
> set fileContent "This is what we will send as if it was the content of a f
ile"
>
> curl::transfer -url http://10.10.20.11/hisap.asp -bodyvar ack -post 1
>         -httppost [list name "name"   bufferName noFile.txt           \
>                        buffer $fileContent contenttype "text/plain"]
>         -httppost [list name "submit" contents "send"]
>
> puts "Server acknowledgment:"
> puts $ack

Actually, believe it or not, they just want the message (XML) and they
will then send back a response (XML).  Perhaps -bodyvar is what I
need.  I had attempted to use  -writeproc.  That works well as long as
everything is at the global level.  But as soon as I try to work
inside a namespace, I get the message "Failed writing body".

Thank you for your help

Report this thread to moderator Post Follow-up to this message
Old Post
Charlie Bursell
10-22-04 01:57 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Tcl archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:29 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.