getting a file name

"John DePasquale" <[email protected]> Mon, 20 Feb 2012 02:04:57 -0500
Newsgroups gmane.comp.lang.perl.active-perl
Message-ID <000801ccef9d$f4fd59d0$def80d70$@net>
Hi all,

I am unable to get a full file name ( including path ) from a form. I'm
using  <input id="filename" type="file" name="filename"> in the form.

 

In the perl code I've tried using both of the following:

 

1:

my $cFile  = substr( CGI::param( 'filename' ), 0, 100 );

 

2:

my $cgi = new CGI();

my $cFile = $cgi->param('filename');

 

the html presents me with a "browse" button, and when I select a file via
the browse I end up with the string c:\images\file.jpg in the input box. 

However, I only get file.jpg assigned to the variable $cFile. I am unable to
acquire the entire value ( i.e. c:\images\file.jpg ), even though that
entire string is appearing in the input box after the file is selected via
the browse button. I'm guessing I'm missing something simple and I've tried
to track down an answer, but I'm stuck. Any help is appreciated. Thank you.

-          john

 

John DePasquale

Chief Executive Officer

Paradigm Consulting

49 Dalby Street

Newton, MA  02458

Mobile: 617-610-2424

Fax: 617-600-7326         

  _____

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs