Strictly speaking this may not be a Perl problem, but since it is Perl related I hope someone here can suggest a solution.

I am uploading a file from an HTML form, but when I access the name of the file within my Perl code I don't get the full path name of the uploaded file. For example, if I upload C:\path\file.txt then:

use CGI; use CGI::Carp qw(fatalsToBrowser); $q = new CGI; $filename = $q->param('uploaded_file'); print "Content-type: text/html\n\n"; print "filename = $filename</br>";
will output:

filename = file.txt

So the full path name must be being stripped out by the browser or the server. My question is how can I access the full path name in my Perl code?

Thanks, J.

In reply to Full path for uploaded file by JanetSilk

Title:
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, details, 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, summary, 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.