Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Re: CGI.pm file upload freaking me out

by Trimbach (Curate)
on Jan 07, 2001 at 02:21 UTC ( [id://50289]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://50289]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-12-09 09:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which IDE have you been most impressed by?













    Results (53 votes). Check out past polls.