Dear John, (and to all other users, please see below for what I had posted back 
to John, My message went direct to him, so I am copy it to bottom of this for 
all others benefits)

Bill Luebkert, gave me an idea;
You could set up a hidden input, then use a JavaScript to copy the value from 
the file input to the hidden when the user submits the form. If that can be dun 
directly, you could do it in 2 steps, copy to clip board then past to text 
input that is obscured from view. This could all be dun by Java with out the 
users involvement. but it is also possible the Microsoft my have created a 
block for that too.

There is one more though, and I can't help you with this even though I know 
Active scraping. But there is a way to use Flash to upload files to a server, 
The benefit has been that you could monitor the progress of the upload, which 
you can't with a form basted uploads. So it may be possible that Flash may be 
more willing to give you the path info as well, It may even be willing to give 
the path of a Mac computer. maybe? I believe that this my be your best bet.

Nonlin
  ----- Original Message ----- 
  From: John DePasquale 
  To: activeperl@listserv.ActiveState.com 
  Sent: Monday, February 20, 2012 2:04 AM
  Subject: getting a file name


  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
  ActivePerl@listserv.ActiveState.com
  To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

  Dear John,

  I may not be considered an expert on this subject, but I have practical 
experience dealing with this.

  Up to about 3 years ago, I used to get full paths from just using the basic 
param sub ruteens from the CGI library. you know:
       use CGI ':standard';

      $data = param('data');
          ect....
  Then I  would use that "while ($chunk = reed ($file, $data, 1024) {" Loop 
thing to upload the file to my server.
  I got the path info for all Windows computers, but overly not from mac. Then 
Microsoft issued a internet explore critical security update and suddenly, no 
more path info. I gather that they don't want hackers to set up web site were 
they uses the param sub routine to gather maps (paths) of the inside of 
visitors computers that they can use the hack them with. 

  Anyway, So I believe that you may be out of luck on this issue, But please 
don't take my word for it. There are at least 2 methods that you can use to see 
all the info that you are being sent by a form. You may end up lucky and find 
another way to get the info that you need.

  1. You can print out all the endearment variables that were used to run your 
script, You should be able to find all the variables and data being posted by 
your form, before the param sub routine gets it's hands on it:
              foreach (keys %ENV){ print "$_ = $ENV{$_}<br>";};

  2. put your form in get mode, then you will see all the variables and data 
displayed in the address bar along with the URL (ie. 
http://localhost/myprojectfolder/myscrip.pl?filename=img.jpg). DO NOTE you 
can't upload any files in get mode, only in post mode, just use get mode to 
diagnose your problem.
  <form name="form1" method="get" action="myscrip.pl" >

  To make absolutely shore, you could try to get your hands on an old copy of 
Internet explore, IE 6 is old enough and compare results from the brewers you 
and what your users are probably using. I think you will come to agree that 
it's all Microsoft (and mozila, and goggle chrome, and ects) fault.

  Sincerely,

  Nonlin


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to