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

Re: [cgiapp] tmpFileName method in CGI::Simple


On 4/25/05, Wojciech Pietron <suppressed> wrote:
> perl, v5.6.1 built for i386-linux
> IO::FILE 1.08
> CGI::Simple 0.077
> 
> Hi,
> 
> I was unable to find dedicated forum for CGI::Simple and I hope to
> find help here.
> 
> While using Data::FormValidator::Constraints::Upload I got the message:
> 
> 'Can't locate object method "tmpFileName" via package "CGI::Simple"
> (perhaps you forgot to load "CGI::Simple"?)'

You do know that Data::FormValidator::Constraints::Upload requires
that you use CGI.pm right?  This is a difficult thing to code around,
since if depends on some low level features of CGI.pm, namely the
ability to get the name of the temporary file of the uploaded file, so
that it can run some tests against this file.

I don't use CGI::Simple (anymore), so I don't know how it deals with
uploads and temporary filenames, but there are really only three ways
around this problem:

1.  Try and get the author of Data::FormValidator::Constraints::Upload
to support CGI::Simple.  Possible, but unlikely, since supporting
multiple CGI type objects is a real pain.

2.  Write your own implementation of tmpFileName that works with
CGI::Simple.  This could be done by creating a subclass of CGI::Simple
(maybe call it My::CGI::Simple), and then creating a method called
tmpFileName that accepts the name of the upload field, and will return
the name of a temporary file that points to the location of the
uploaded file.

3.  Just use CGI.pm which works with everything...  I know it is a big
beast of a module, but it is included in the core perl distribution,
and all modules that need CGI style parameters support it.

Cheers,

Cees

> I went through the documentation of CGI::Simple and found out it is
> IO::File that is responsible for method 'tmpFileName'. But it hasn't
> such a method and it doesn't import it either.
> 
> Does anybody know where is the problem? How can I take advantage of
> tmpFileName function?
> 
> Thank you for your patience.
> Best regards,
> Wojciech Pietron
> 
> ---------------------------------------------------------------------
> Web Archive:  http://www.mail-archive.com/suppressed/
>               http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
> To unsubscribe, e-mail: suppressed
> For additional commands, e-mail: suppressed
> 
>

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.