CGI-FileUpload
view release on metacpan or search on metacpan
cgi/cgi-fileupload-manager.pl view on Meta::CPAN
737475767778798081828384858687888990919293
<th><input type=
'submit'
value=
'remove'
name=
'action'
/></th>
</td>
EOT
# TODO get creation time + set it coherent with sort
my
$id
=CGI::FileUpload::idcookie(
query
=>
$query
)->{id};
foreach
(
@fus
){
next
unless
$isAdmin
|| (
$_
->from_id() eq
$id
);
my
$status
=
$_
->upload_status();
" <tr>\n"
;
" <td>"
.
$_
->file_orig().
"</td>\n"
;
" <td>"
.(ctime((
stat
(
$_
->file(
'.properties'
)))[9])).
"</td>\n"
;
" <td>$status</td>\n"
;
" <td>"
.((
$status
eq
'completed'
)?(-s
$_
->file()):
'n/a'
).
"</td>\n"
;
" <td>"
.
$_
->from_ipaddr().
"</td>\n"
;
" <td>"
.
$_
->from_id().
"</td>\n"
if
$isAdmin
;
" <td align='center'><input type='checkbox' name='key' value='"
.
$_
->key().
"'/></td></tr>\n"
;
}
<<EOT;
</table>
</form>
<form >
lib/CGI/FileUpload/Manager.pm view on Meta::CPAN
9293949596979899100101102103104105106107108109110111112our
(
@ISA
,
@EXPORT
,
@EXPORT_OK
);
@ISA
=
qw (Exporter);
@EXPORT=qw(&ls
&lskey
);
@EXPORT_OK
=
qw()
;
sub
lskey{
my
%tmp
;
foreach
(
glob
CGI::FileUpload::uploadDirectory().
"/*.properties"
){
my
$k
=basename(
$_
);
$k
=~s/\.properties$//;
$tmp
{
$k
}=(
stat
(
$_
))[9];
}
return
sort
{
$tmp
{
$b
} <=>
$tmp
{
$a
}}
keys
%tmp
;
}
sub
ls{
my
@keys
=lskey();
my
@ret
;
foreach
(
@keys
){
push
@ret
, CGI::FileUpload->new(
key
=>
$_
);
}
( run in 0.334 second using v1.01-cache-2.11-cpan-5f2e87ce722 )