Re: How could i Post binary data to perl cgi?

2004-02-22 Thread Dave Cragg
At 1:29 am -0600 22/2/04, Chipp Walters wrote:
Alejandro,

Contact Dave Cragg about this. We've been working with him to do 
just what you want in the last couple months.
I've contacted Al off list about getting this working.

For everyone else, a beta version of libUrl incorporating multipart 
form support (and some other things) will be available soon. I just 
need to get the documentation in order.

Cheers
Dave
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


How could i Post binary data to perl cgi?

2004-02-21 Thread Alejandro Tejada
Hi Developers,

I have been working hard to employ
the method post for uploading
files to a web server.

I have used HTTP interceptor v1.3
to check the differences between the
data send by browsers and RR/MC.

These are the results:

Http headers send from Netscape:

POST /cgi-bin/upload.cgi HTTP/1.0
Referer: http://www.mywebsite.com/postfiles.html
Connection: Close
User-Agent: Mozilla/4.8 [en] (Win98; U)
Host: www.mywebsite.com
Accept: image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, image/png, */*
Accept-Encoding: gzip
Accept-Language: en
Accept-Charset: iso-8859-1,*,utf-8
Content-type: multipart/form-data;
boundary=---277072699622422
Content-Length: 15909

Data found after header end:

-277072699622422
Content-Disposition: form-data; name=FILE1;
filename=C:\Mis documentos\candado.gif
Content-Type: image/gif

GIF89aJ


Based in these results, i changed the script
to closely match the http produced by Netscape:

This was the headers result:

POST /cgi-bin/upload.cgi HTTP/1.1
Host: www.mywebsite.com
User-Agent: Metacard (Win32)
Content-Length: 15703
Content-type: multipart/form-data

Data found after header end:

Content-Disposition: form-data; name=FILE1;
filename=C:\Mis documentos\candado.gif
Content-Type: image/gif

GIF89aJ 

But the server returns
Malformed Post request. :-(

This is the script that
produced this malformed post:

on mouseUp
  -- Setting httpheaders as recommended by Dave Cragg
  -- in the message HTTP headers for posting data
  put Content-type: multipart/form-data into
tHeaders
  set the httpHeaders to tHeaders

put http://www.mywebsite.com/cgi-bin/upload.cgi; into
tUrl
  put Content-Disposition: form-data; name=  quote
 FILE1  quote  ; filename=  quote  C:\Mis
documentos\candado.gif  quote into tString
  put crlf after tString
  put Content-Type: image/gif after tString
  put crlf  crlf after tString
  
set the customprop1 of the topstack to url
binfile:C:/Mis documentos/candado.gif
put the customprop1 of the topstack after tString
  put crlf after tString
  post tString to url tUrl
  -- put tString -- uncomment for debug
  if the result is empty
  then
put it --
set the htmltext of fld result to it
else
answer the result
  end if
end mouseUp

If you could see the errors in this script,
post them here or send clues to my mail.

Thanks in advance.

al


=
Visit my site:
http://www.geocities.com/capellan2000/
Search the mail list:
http://mindlube.com/cgi-bin/search-use-rev.cgi

__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How could i Post binary data to perl cgi?

2004-02-21 Thread [EMAIL PROTECTED]
 Content-type: multipart/form-data;
 boundary=---277072699622422

you're forgetting the boundary marker.. (note that the above is all 
one line, or two seperate lines with LWS before the word boundary)


-Sean

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How could i Post binary data to perl cgi?

2004-02-21 Thread Alejandro Tejada
on Sat, 21 Feb 2004 11:00:12 -0500
[EMAIL PROTECTED] wrote:
 
Content-type: multipart/form-data;
boundary=---277072699622422
 
 you're forgetting the boundary marker.. (note that
 the above is all 
 one line, or two seperate lines with LWS before the
 word boundary)

Thanks a lot Sean for step-in on this question.

I've add the boundary marker, but this only
produces the same error.

I'm using the perl cgi script: Upload Lite
from the site:

http://www.perlscriptsjavascripts.com/perl/upload_lite/

Do you have success uploading files to a cgi or
php script in a server from RR/MC?

I noticed that you use base64encode to attach
files to email messages.

Does libUrl supports uploading binary files 
in this way?

Dave Cragg does not says that uploading binary
files using post will not works, so i'll keep 
posting my errors, so interested developers
will help or at least not repeat them.
 
Thanks again Sean! :-)

al

on Sat, 21 Feb 2004 07:47:52 -0800 (PST)
Alejandro Tejada wrote:

 Hi Developers,
 
 I have been working hard to employ
 the method post for uploading
 files to a web server.
 
 I have used HTTP interceptor v1.3
 to check the differences between the
 data send by browsers and RR/MC.
 
 These are the results:
 
 Http headers send from Netscape:
 
 POST /cgi-bin/upload.cgi HTTP/1.0
 Referer: http://www.mywebsite.com/postfiles.html
 Connection: Close
 User-Agent: Mozilla/4.8 [en] (Win98; U)
 Host: www.mywebsite.com
 Accept: image/gif, image/x-xbitmap, image/jpeg,
 image/pjpeg, image/png, */*
 Accept-Encoding: gzip
 Accept-Language: en
 Accept-Charset: iso-8859-1,*,utf-8
 Content-type: multipart/form-data;
 boundary=---277072699622422
 Content-Length: 15909
 
 Data found after header end:
 
 -277072699622422
 Content-Disposition: form-data; name=FILE1;
 filename=C:\Mis documentos\candado.gif
 Content-Type: image/gif
 
 GIF89aJ
 
 
 Based in these results, i changed the script
 to closely match the http produced by Netscape:
 
 This was the headers result:
 
 POST /cgi-bin/upload.cgi HTTP/1.1
 Host: www.mywebsite.com
 User-Agent: Metacard (Win32)
 Content-Length: 15703
 Content-type: multipart/form-data
 
 Data found after header end:
 
 Content-Disposition: form-data; name=FILE1;
 filename=C:\Mis documentos\candado.gif
 Content-Type: image/gif
 
 GIF89aJ 
 
 But the server returns
 Malformed Post request. :-(
 
 This is the script that
 produced this malformed post:
 
 on mouseUp
   -- Setting httpheaders as recommended by Dave
 Cragg
   -- in the message HTTP headers for posting data
   put Content-type: multipart/form-data into
 tHeaders
   set the httpHeaders to tHeaders
 
 put http://www.mywebsite.com/cgi-bin/upload.cgi;
 into
 tUrl
   put Content-Disposition: form-data; name= 
 quote
  FILE1  quote  ; filename=  quote  C:\Mis
 documentos\candado.gif  quote into tString
   put crlf after tString
   put Content-Type: image/gif after tString
   put crlf  crlf after tString
   
 set the customprop1 of the topstack to url
 binfile:C:/Mis documentos/candado.gif
 put the customprop1 of the topstack after tString
   put crlf after tString
   post tString to url tUrl
   -- put tString -- uncomment for debug
   if the result is empty
   then
 put it --
 set the htmltext of fld result to it
 else
 answer the result
   end if
 end mouseUp
 
 If you could see the errors in this script,
 post them here or send clues to my mail.
 
 Thanks in advance.
 
 al


=
Visit my site:
http://www.geocities.com/capellan2000/
Search the mail list:
http://mindlube.com/cgi-bin/search-use-rev.cgi

__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: How could i Post binary data to perl cgi?

2004-02-21 Thread Chipp Walters
Alejandro,

Contact Dave Cragg about this. We've been working with him to do just 
what you want in the last couple months.

-Chipp

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution


How could i Post binary data to perl cgi?

2004-02-18 Thread Alejandro Tejada
Hi developers,

After reading the examples in
the libUrl documentation,
i have success posting a
form to a cgi script.

Now, i'm experimenting to
post binary data to a website.
I do not find an specific
example to make this.

Did I had to encode the
binary data with urlencode or
base64encode, before posting the
data to the cgi in the website?

How could i interpret this html form
for using from within liburl in RunRev?

form
action=http://www.yourserver.com/cgi-bin/upload.cgi; 
method=post 
enctype=multipart/form-data
input type=File name=FILE1
p
input type=Submit value=submit
/form 

I understand that ftp is available,
to upload files, but using perl cgi 
has many advantages, like email
notification, etc.

In fact, Chipp Walters create code
to post files to a specific type of
server, but i test it with the server
i'm using and did not works.

Thanks in advance.

al

=
Visit my site:
http://www.geocities.com/capellan2000/
Search the mail list:
http://mindlube.com/cgi-bin/search-use-rev.cgi

__
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution