[FoLUG] Ancora problemi su upload file su server
chris osu
chris_osu_edu@yahoo.com
Mar 6 Feb 2007 23:50:07 CET
Fai cosi':
******************************Blast_parsing.htm***************************
<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 parse:</strong>
<input type="file" name="upload">
<p>
<center>
<input type="submit" name="submit" 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';
#$out = start_multipart_form.filefield(-name => 'upload'); #fa comparire submit nella pagina dei risultati
#$out .= br.submit('submit','Send').end_form; #fa comparire submit nella pagina dei risultati
$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;
Il primo file lo metti nella cartella di html di apache, l'altro nella cartella cgi-bin e gli dai i permessi 755
ciao
paolo siniselli <paolo_siniselli@yahoo.it> wrote:
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*****************************************
/* Parse you blast chip ver. 3 file
*/
Choose file to upload:
[input]
[input]
Last Update: January 25, 2007
*****************************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!
_______________________________________________
FoLUG mailing list
FoLUG@lists.linux.it
http://lists.linux.it/listinfo/folug per cancellarsi dalla lista
---------------------------------
Bored stiff? Loosen up...
Download and play hundreds of games for free on Yahoo! Games.
Maggiori informazioni sulla lista
FoLUG