Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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

In reply to Re^3: @CGI $q->upload() doesnt work properly by Anonymous Monk
in thread @CGI $q->upload() doesnt work properly by AlexTape

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others making s'mores by the fire in the courtyard of the Monastery: (4)
    As of 2018-05-27 02:01 GMT
    Find Nodes?
      Voting Booth?