in reply to Re: CGI.pm file upload freaking me out
in thread CGI.pm file upload freaking me out

I tried your test script and it works perfectly on my server, but after changing my code a bit to reflect yours it still wasn't working. So... the problem wasn't with CGI, but rather with something I did somewhere else in my script.

After some investigation I discovered that apparantly at some point in my development (remember, this is old code) I switched from the OO-style CGI interface to the functional interface, with about 99% using param(blah) and the rest using $object->param(blah). CGI.pm apparantly doesn't have a problem when you mix interfaces for most functions (my HTML-generation and parameter fetching all worked fine) but it apparantly hoses the magic upload functions. Imagine that. :-D Once I took out $object = new CGI; everything miraculously started working.

Remember what I said at the beginning? Well, I'm an idiot. Although I didn't intend to, the lesson here is obvious: don't mix your interfaces in CGI.pm.

Thanks to all who took the time to post... I sure do appreciate it!

Gary Blackburn
Trained Killer

Replies are listed 'Best First'.
Re: Re: Re: CGI.pm file upload freaking me out
by markjugg (Curate) on Mar 28, 2001 at 00:38 UTC
    Hmm. I wonder if this was at the core of the uploadInfo issue. I just got stuck in the same spot with the hash ref error and tried using 100% OO and 100% functional, and I got the same error both ways. Is it possible some files just wouldn't have a mime type associated with them?

    update: I have to take that back: I found a "$q = new CGI" in an included module which I think was related. When I used this existing query object to call uploadInfo, it started working.

    -mark