Apache-AxKit-Plugin-Upload

 view release on metacpan or  search on metacpan

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

      </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 {
    my ($r,$upload_id) = @_;
    my $destdir = $r->dir_config('AxUploadStatusDir') || return 0;
    $destdir = $r->document_root.'/'.$destdir if substr($destdir,0,1) ne '/';
    my $destloc = $r->dir_config('AxUploadStatusLocation') || return 0;
    my $format = lc($r->dir_config('AxUploadFormat')) || 'html';
    $location = "$destloc/$upload_id.$format";
    $file = "$destdir/$upload_id.$format";

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

  <head>
    <title>Upload Status</title>
    <meta http-equiv="Refresh" CONTENT="1; URL=$location" />
  </head>
  <body bgcolor="#ffffff" text="#ffffff">
    &nbsp;
  </body>
</html>
EOF
    close(FH);
    rename("$file.tmp",$file);
}

sub progress {
    my ($done, $total, $message) = @_;
    my $now = time();
    my $elapsed = $now-$start;

    my $todo = 0;
    $todo = ($total - $done) * $elapsed / $done if $done > 0;
    

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

      <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);
}

sub is_running {
    my ($r,$upload_id) = @_;
    return 0 if ($running eq $upload_id);
    my $destdir = $r->dir_config('AxUploadStatusDir') || return 0;
    $destdir = $r->document_root.'/'.$destdir if substr($destdir,0,1) ne '/';
    my $format = lc($r->dir_config('AxUploadFormat')) || 'html';
    $file = $destdir."/".$upload_id.".".$format;
    local (*FH);



( run in 0.999 second using v1.01-cache-2.11-cpan-131fc08a04b )