octavian Rasnita wrote:
> Is it possible to use a text field for uploading files, or I need to use
> only a file field?
> I have some reasons for wanting only a text file.
use an <input type="file" name="up_file"> in your html. to restrict
file types, examine the uploaded file's content type:
use CGI;
my $cgi = new CGI;
my $type = $cgi->uploadInfo('up_file')->{'Content-Type'};
return "File is not plain text" unless $type eq 'text/plain';
i'm not sure about the 'text/plain' part - you'd have to test it to
figure out exactly what to look for.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]