$writed=param($parampath);
&upfile;
&g_body;
}
&g_bott;
#<<<<<<<<<<<<<<<<<<<<<以下为自定义过程<<<<<<<<<<<<<<<<<<<<<<<<<
sub upfile
{
$maxdata = 512000;
# $writed = '../www/test/tmp/';
$strRFname=reverse $xfile;
$intIndex=index($strRFname,'\');
$strNetFname=substr($strRFname,0,$intIndex);
$strNetFname=scalar reverse $strNetFname;
if((stat $xfile)[7]>$maxdata){
print "Status: 411 Size Not Allowedn" .
"Content-Type: text/htmlnAllow: POSTnn" .
"<html><head><title>411 411 Size Not Allowed</title></head><body><h1> You got big problem. Try again.</h1></body></html>n";
exit 0;
}
binmode $xfile;
use File::Copy;
copy($xfile,$writed.$strNetFname);
}
sub g_head{
print '<table border=1 align=center>';
print '<tr><td colspan=3 align=center>文件上传结果(Upload Result)</td></tr>';
print '<tr align=center>';
print ' <td>SourceFile:</td>';
print ' <td>DestFile:</td>';
print ' <td>Upload</td>';
print '</tr>';
}
sub g_body{
print '<tr>';
print ' <td>'.$xfile .'</td>';
print ' <td>'.$writed.$strNetFname.'</td>';
print ' <td>OK!</td>';
print '</tr>';
}
sub g_bott{
print '</table>';
}
----------------------------------------------------------------------
如有好的建议请 Email: gearsoft@netease.com
本文章更多内容:<<上一页 - 1 - 2 |