Apache-AxKit-Plugin-Upload

 view release on metacpan or  search on metacpan

lib/Apache/AxKit/Plugin/Upload.pm  view on Meta::CPAN


    if (!$custom && $percent == 100) {
        print FH << "EOF";
<html>
  <head>
    <title>Upload Status</title>
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <table border="0" width="264" cellspacing="0" cellpadding="1" style="table-layout: fixed;">
      <tr>
        <td width="40" height="24"><font face="sans-serif">$percent\%</font></td>
        <td width="224" height="24" bgcolor="#000000"><table border="0" width="222" cellspacing="0" cellpadding="1" style="table-layout: fixed;" bgcolor="#ffffff">
          <tr>
            <td height="22"><table border="0" width="$showpercent\%" cellspacing="0" cellpadding="0" style="table-layout: fixed;">
              <tr><td height="20" bgcolor="#000080"><font size="-7">&nbsp;</font></td></tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td align="center"><font face="sans-serif" size="-1">$sizedone / $sizetotal, ${speed}b/s, $todo</font></td>
      </tr>
    </table>
    <font color="#ffffff"><script language="javascript">window.close()</script></font>
  </body>
</html>
EOF
    } else {
        print FH << "EOF";
<html>
  <head>
    <title>Upload Status</title>
    <meta http-equiv="Refresh" CONTENT="1; URL=$location" />
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <table border="0" width="264" cellspacing="0" cellpadding="1" style="table-layout: fixed;">
      <tr>
        <td width="40" height="24"><font face="sans-serif">$percent\%</font></td>
        <td width="224" height="24" bgcolor="#000000"><table border="0" width="222" cellspacing="0" cellpadding="1" style="table-layout: fixed;" bgcolor="#ffffff">
          <tr>
            <td height="22"><table border="0" width="$showpercent\%" cellspacing="0" cellpadding="0" style="table-layout: fixed;">
              <tr><td height="20" bgcolor="#000080"><font size="-7">&nbsp;</font></td></tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td align="center"><font face="sans-serif" size="-1">$sizedone / $sizetotal, ${speed}b/s, $todo</font></td>
      </tr>
    </table>
  </body>
</html>
EOF
    }
    rename("$file.tmp",$file);
}

sub init {

lib/Apache/AxKit/Plugin/Upload.pm  view on Meta::CPAN

    open(FH, ">$file.tmp") || warn("could not open $file.tmp: $!");
    if ($percent == 100) {
        print FH << "EOF";
<html>
  <head>
    <title>Upload Status</title>
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <table border="0" width="264" cellspacing="0" cellpadding="1" style="table-layout: fixed;">
      <tr>
        <td width="40" height="24"><font face="sans-serif" size="-1">$percent\%</font></td>
        <td width="224" height="24" bgcolor="#000000"><table border="0" width="222" cellspacing="0" cellpadding="1" style="table-layout: fixed;" bgcolor="#ffffff">
          <tr>
            <td height="22"><table border="0" width="$showpercent\%" cellspacing="0" cellpadding="0" style="table-layout: fixed;">
              <tr><td height="20" bgcolor="#000080"><font size="-7">&nbsp;</font></td></tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td align="center"><font face="sans-serif" size="-1">$message</font></td>
      </tr>
    </table>
    <font color="#ffffff"><script language="javascript">window.close()</script></font>
  </body>
</html>
EOF
        close($lock);
    } else {
        print FH << "EOF";
<html>
  <head>
    <title>Upload Status</title>
    <meta http-equiv="Refresh" CONTENT="1; URL=$location" />
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <table border="0" width="264" cellspacing="0" cellpadding="1" style="table-layout: fixed;">
      <tr>
        <td width="40" height="24"><font face="sans-serif" size="-1">$percent\%</font></td>
        <td width="224" height="24" bgcolor="#000000"><table border="0" width="222" cellspacing="0" cellpadding="1" style="table-layout: fixed;" bgcolor="#ffffff">
          <tr>
            <td height="22"><table border="0" width="$showpercent\%" cellspacing="0" cellpadding="0" style="table-layout: fixed;">
              <tr><td height="20" bgcolor="#000080"><font size="-7">&nbsp;</font></td></tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td align="center"><font face="sans-serif" size="-1">$message</font></td>
      </tr>
    </table>
  </body>
</html>
EOF
    }
    close(FH);
    rename("$file.tmp",$file);
}



( run in 0.869 second using v1.01-cache-2.11-cpan-5735350b133 )