How could i Post binary data to perl cgi?

Alejandro Tejada capellan2000 at yahoo.com
Fri Feb 20 03:37:43 EST 2004


Hi Developers,

Here is the script that i'm using to post
binary data to a perl cgi in a server:

It fails with this message:

One or more files failed to upload. 
The reasons returned are: 
No files were selected for uploading

Every insight is highly appreciated.
Thanks in advance.

on mouseUp
  -- Setting httpheaders as recommended by Dave Cragg
  -- in the message "HTTP headers for posting data"
  put "User-Agent: MyApp 1.0" into tHeaders
  -- put return & "Connection: close" after tHeaders
  set the httpHeaders to tHeaders
  
  put "http://www.myhost.com/cgi-bin/upload.cgi" into
tUrl
  put "enctype=multipart/form-data" into tString
  put "CONTENT_TYPE=application/x-octet-stream-b2a
filename=" & fld "filename" after tString
  get url quote & "binfile:" & fld "filename" & quote
  put base64encode(it) after tString
  put crlf after tString
  post tString to url tUrl
  -- put tString -- uncomment for debug
  if the result is empty
  then
    put it -- into localvariable
    set the htmltext of fld "result" to it 
else
    answer the result
  end if
end mouseUp

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


More information about the metacard mailing list