Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: @CGI $q->upload() doesnt work properly

by Anonymous Monk
on Mar 09, 2012 at 12:55 UTC ( #958700=note: print w/ replies, xml ) Need Help??


in reply to Re^2: @CGI $q->upload() doesnt work properly
in thread @CGI $q->upload() doesnt work properly

hm ok.. but thats not new to me.. the code i show you is only part of an package. the cgi object lies in the main. for that itīs not a scoping issue.

:) Um, if you know this is bad way to code (multiple exit points, action at a distance, not maintainable), why continue to use globals like that and call exit?

my $filename = $q->param('upload_file'); gives exactly the filename of the uploaded file. but not full qualified.

Except that it only gives what the browser sends, and the browser can send anything, including a full path full of dots, or anything at all. You're trusting the browser/user to not be evil. Don't trust, code so as to protect yourself. Full path for uploaded file, Security issues when allowing file upload via CGI, use taint and launder dirty data

but the filehandle is empty. thats what i want to fix.

Do you have the latest version of CGI? You should. Then, if filehandle is still empty, there must be something in cgi_error or in server logs

i want to know what this function do

Well, see both CGI documentation and sourcecode and you'll know :) its undef on error


Comment on Re^3: @CGI $q->upload() doesnt work properly
Re^4: @CGI $q->upload() doesnt work properly
by AlexTape (Monk) on Mar 09, 2012 at 13:31 UTC
    :) Um, if you know this is bad way to code (multiple exit points, action at a distance, not maintainable), why continue to use globals like that and call exit?
    :) your completly right.. iīm desperated in finding any error message. for that the code is full of any exits to test what happen in that part of the script. the pm is more then 1600 lines.. donīt want to go further with an empty file ^^

    the cgi_error is still empty. should check the server logs... mh tmpFileName() looks intresting ;-)

    thanks for advice!
    $perlig =~ s/pec/cep/g if 'errors expected';

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2014-09-15 10:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (146 votes), past polls