[FoLUG] Ancora problemi su upload file su server

paolo siniselli paolo_siniselli@yahoo.it
Dom 4 Feb 2007 18:27:16 CET


Salve mi sono letto il cgi doc e sono andato nel link che mi avete detto, ma ancora non riesco ad uploadare il file da una pagin html al mio server apache
  Qui sotto vi mando la pagina html che uploada il file sul server e il file cgi in perl che dovrebbe ritornare il file di testo sul browser... ovviamente mi da' errore... sapete dov'e'?
  Grazie 1000
   
   
  ****************************************HTML*****************************************
  <html>
<head>
<title>Blast parsing analysis</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body bgcolor="#9999FF">
<p align="center"><strong><em><font size="6">/* Parse you blast chip ver. 3 file 
  */</font></em></strong> </p>
<br>
<br>
<br>
<form name="myform" enctype="multipart/form-data" method="post" action="/cgi-bin/parsing.cgi" >
    <p><strong>Choose file to upload:</strong> 
    <input type="file" name="mio_file">
  <p> 
  <center>
    <input type="submit" name="upload" value="Submit blast">
 </center>
  </p>
</form>
  
<center>
  <font size="-1">Last Update: January 25, 2007 </font> 
</center>
 
</body>
</html>

  *****************************parsing.cgi*********************************************
  #!/usr/bin/perl -Tw
use CGI ':standard';
use strict;
  my $out = start_multipart_form.filefield(-name => 'upload');
$out .= br.submit('submit','Send').end_form;
my $file = param('upload');   #the filename returned is also a file handle
if(request_method eq 'POST' &&
    defined $file && ref $file && ref $file eq 'Fh')
{
    local $/ = undef; #read the whole file
    $out .= pre <$file>||''; #takes care not to send uninitialized value
    close $file if ::OS ne 'UNIX'; #such as Win32 platforms
}
  print header,start_html('Sample upload page'),$out,end_html;

 		
---------------------------------
Vinci i biglietti per FIFA World Cup in Germania!


Maggiori informazioni sulla lista FoLUG