|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
Re: simple CGI::upload_hook() guide or example?by cees (Curate) |
| on Oct 12, 2005 at 17:52 UTC ( #499616=note: print w/ replies, xml ) | Need Help?? |
|
OK, here is a completely stripped down version that just writes some data to a log file. This works fine on my machine
And here is a simple HTML page that you can use to call it:
My gut instinct tells me that your test DID work, but your logfile was just buffering the output. To guarantee that it doesn't happen with this example, I am doing something very inefficient by opening and closing the log file on every call to the hook. Also, I should note that the CGI.pm docs are not very clear in how to use the upload hook. CGI.pm needs to know about the hook when it is first used, so you have to call CGI::upload_hook(\&hook,$data); before you do anything else. And if you use the OO interface like I do, you must pass the hook in at creation time.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||