[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Problems with CGI.pm's $query->filefield



I know that this has not much to do with MacPerl per se, but has anybody else
ever encountered problems while using CGI.pm's filefield (uploading) function?
The following bit of code lets you upload a file to a server. However, when
you press the submit button called "Envoyer", you get the following error message:

"Diagnostic Output

# CGI open of .:CGItemp10001: Invalid argument"

Is this due to a bug in CGI.pm or something else?

By the way, I am using MacPerl 5.1.8.

Anyone's help would be greatly appreciated.

Philippe de Rochambeau

==================== Code begins here ============================

#!perl
# Nom : testUpload.pl
# Date : 11/2/98
# But : Tester les possibilitˇs du file upload

my ($query, $p, $br);

$p = "<P>";
$br = "<BR>";

use CGI;

$query = new CGI;

print $query->header;
print $query->start_html(-title=>'Chargement de fichier');
print $query->start_multipart_form(-action=>'testFileRecup.acgi');

print $p . "Sujet : ";
print $query->textfield(-name=>'sujet',
						-default=>'Sujet',
						-size=>40,
						-maxlength=>40);
						
print $p . "Cat&eacute;gorie : ";
print $query->popup_menu(-name=>'categorie',
						-values=>['cat1','cat2','cat3','cat4','autre'],
						-default=>'cat1');
						
print $p . "Remarques : ";
print $query->textarea(-name=>'remarques',
						-default=>'Remarques',
						-rows=>10,
						-columns=>50);
						
print $p. "Pi&egrave;ces jointes : ";
print $query->filefield(-name=>'fichiercharge');

print $p;

print $query->submit(-name=>'Envoyer');
print $query->endform;

if ($query->param()) {

print "<P>Parametres:\n";
print $br;

print $p . $query->param('sujet');
print $p . $query->param('categorie');
print $p . $query->param('remarques');
print $p . $query->param('fichiercharge');
}

print $query->end_html;

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch