Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Form Data and CGI scripts

0 views
Skip to first unread message

todd murray

unread,
Feb 11, 2003, 10:07:40 PM2/11/03
to
webserver: iis4 with CGI configured

I have created an PDF form with a submit button. How do you get the data from the pdf to the web server using CGI. I have some knowledge of perl scripting. I have used a CGI parsing script to receive HTML form data and store it as an text file on the web server. But this same script will not work on PDF's. I have read the sdk in regards to perl, but I still can not connect the dots. In the CGI script do you save the "data" as a *.txt, *.fdf or *.pdf ? What is the parsing code needed ? Here is a sample of the parsing code I use for HTML forms.

sub get_form_data
{
# GET the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# Split the name-value pairs
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
# Un-Webify plus signs and %-encoding
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s///g;
$FORM{ $name } = $ value;
}

Aandi Inston

unread,
Feb 11, 2003, 11:02:35 PM2/11/03
to
Your code looks as though it should work, provided the form submit
specifies HTML format. If you choose this format, Acrobat is very
similar to a POST submission from a web page.

You do lose the flexibility that comes from submitting in FDF format,
though.

Aandi Inston

0 new messages