in reply to File Upload without using CGI.pm upload function

Hello,

You could use CGI::Simple. It is supposed to be a drop in replacement for the CGI module, but doesn't have all the dependency problems and loading complexities.

regards,

  • Comment on Re: File Upload without using CGI.pm upload function

Replies are listed 'Best First'.
Re^2: File Upload without using CGI.pm upload function
by cbanker (Beadle) on Jun 26, 2009 at 23:25 UTC
    Thank you very much trwww! CGI::Simple worked perfectly without having to modify my old code or the module. As an added bonus, I am a seeing a very significant speed increase with CGI::Simple.

    I wouldn't have thought to look at the CGI::Simple module, so I'm really glad I asked here.
Re^2: File Upload without using CGI.pm upload function
by cbanker (Beadle) on Jun 29, 2009 at 21:16 UTC
    Just a quick follow-up in case someone comes across a similar issue in the future:

    After further testing, I found that CGI::Simple actually didn't quite work for file uploads without modification. I initially did not enable uploads (turned off by default in CGI::Simple), so the upload function was not being called. New files were being created in the filesystem, but remained empty.

    CGI::Simple uses IO::File for file handles, which requires dynamic loading. I was able to remedy this by modifying the _save_tmpfile function to not require IO::File and instead use open() to create a temp file. File uploading now seems to work fine.