submit with binary attachments

sabety
Posts: 76
Joined: Wed Dec 06, 2000 7:11 am

submit with binary attachments

Post by sabety »

I am trying to use the <submit> function to upload both character and binary data to another vortex function.

In this case the binary data is a pdf file. The vortex script at the other end doesn't see anything past the first null character in the pdf file.

Normally in a form element, I use "ENCTYPE="multipart/form-data"".
I'm not at all sure if this will work in the vortex form submitting function. many thanks for any help.
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

submit with binary attachments

Post by Kai »

Yes, this will work with Vortex; I assume you're using an <INPUT TYPE=file> tag on the form as well. How exactly are you manipulating the PDF file's variable once in Vortex? Some Vortex functions deal only with strings, and will stop at nul. For example, <send> takes string arguments and will stop at nul, while <fmt>/<strfmt> can deal with binary data.
sabety
Posts: 76
Joined: Wed Dec 06, 2000 7:11 am

submit with binary attachments

Post by sabety »

Here is a snippet:


SCRIPT 1
-----------------------
<SQL ROW "select id,TITLE,PDF from $TABLE">
<submit METHOD=POST URL="http://xx.xx.xx.xx/cgi-bin/texis.exe/ts ... rodupdate2"
MODTYPE=$MODTYPE
TABLE=$TABLE
id=$FILEID
TITLE=$TITLE
PDF=$PDF>
</SQL>


SCRIPT2
------------------------
<SQL NOVARS "INSERT INTO $TABLE (id,TITLE,PDF) values (COUNTER,$TITLE,$PDF)"></SQL>


so I am basically just streaming this data from one machine to another.
sabety
Posts: 76
Joined: Wed Dec 06, 2000 7:11 am

submit with binary attachments

Post by sabety »

I goofed up the syntax but it's just to give you an idea of where I'm headed
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

submit with binary attachments

Post by Kai »

What is the type of the PDF column in your source table? Have you confirmed that you can select it completely from the table (print it with <fmt "%s" $PDF>)? If it's char or varchar, then it may be truncated at the <SQL> select.
sabety
Posts: 76
Joined: Wed Dec 06, 2000 7:11 am

submit with binary attachments

Post by sabety »

varbyte in both source and destination tables.

I had a local print on the source machine for every pdf row, which I checked to make sure there were no problems, and there doesn't seem to be.
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

submit with binary attachments

Post by Kai »

What's the date of your Vortex (output of texis -version)? It looks like support for binary types in <submit> was only added in October 2000.
sabety
Posts: 76
Joined: Wed Dec 06, 2000 7:11 am

submit with binary attachments

Post by sabety »

Texis Web Script (Vortex) Copyright (c) 1996-2001 Thunderstone - EPI, Inc.
Commercial Version 3.01.996181900 of Jul 26, 2001 (i686-intel-winnt-32)
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

submit with binary attachments

Post by Kai »

Is this the date of the Vortex doing the <submit>, or the one accepting it? What's the date of the other one, if different?
sabety
Posts: 76
Joined: Wed Dec 06, 2000 7:11 am

submit with binary attachments

Post by sabety »

Ah!

the one accepting is:

Texis Web Script (Vortex) Copyright (c) 1996-2000 Thunderstone - EPI, Inc.
Commercial Version 3.01.965857894 of Aug 9, 2000 (i686-intel-winnt)

that would explain it.