<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
>
<html>
<head>
<title>UploadFiles</title>
<META NAME=
"Author"
CONTENT=
"Gabriele Hoevel"
>
<META NAME=
"Publisher"
CONTENT=
"Gabriele Hoevel"
>
<META NAME=
"Copyright"
CONTENT=
"Gabriele Hoevel"
>
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=iso-8859-1"
>
<meta http-equiv=
"Content-Style-Type"
content=
"text/css"
/>
<link rel=
"stylesheet"
type=
"text/css"
href=
"table.css"
>
</head>
<BODY>
<div id=
"content"
>
<h1>UploadFiles V1.2</h1>
<?php
$filepath
=
$DOCUMENT_ROOT
.
"/gfx/mygfx/"
;
if
(
$upfile_name
!=
""
) {
if
(!
file_exists
(
$filepath
.
$_FILES
[
'upfile'
][
'name'
])) {
if
(move_uploaded_file(
$_FILES
[
'upfile'
][
'tmp_name'
],
$filepath
.
$_FILES
[
'upfile'
][
'name'
])) {
echo
"<p>deine Datei wurde gespeichert</p>"
;
}
else
{
echo
"<p>Leider fehlgeschlagen</p>"
;
}
}
else
{
echo
" <p>du hast keine Datei definiert.</p>"
;
}
}
unset(
$files
);
if
(
$dh
= opendir(
$filepath
))
{
while
(
$file
= readdir(
$dh
))
{
if
(!
ereg
(
"^\.+$"
,
$file
))
{
$files
[] =
$file
;
}
}
closedir
(
$dh
);
}
$webpath
=
"mygfx/"
;
if
(
is_array
(
$files
)) {
echo
"<table border=\"0\" cellpadding=\2\"
cellspacing=\
"5\" width=\"100%\">\r\n"
;
echo
"<tr>"
;
echo
"<th>Datei</th>"
;
echo
"<th>Grösse</th>"
;
echo
"<th>Datum</th>"
;
echo
"<th colspan=\"2\">Aktionen</th></tr>\r\n"
;
natcasesort(
$files
);
reset(
$files
);
foreach
(
$files
as
$idx
=>
$file
)
{
if
(
$idx
% 2) {
echo
"<tr bgcolor=\"#D2F0E1\">"
;
}
else
{
echo
"<tr bgcolor=\"#E1FFFF\">"
;
}
printf ("<td><a href=\"%s%s\"
target=\
"_self\">%s</a></td>"
,
$webpath
,
$file
,
$file
);
printf (
"<td align=\"right\">%s Bytes</td>"
,
number_format(
filesize
(
$filepath
.
$file
), 0,
","
,
"."
));
printf (
"<td align=\"center\">%s</td>"
,
date
(
"d.m.Y. H:i:s"
,
filemtime
(
$filepath
.
$file
)));
printf (
"<td><a href=\"%s?file=%s\"><strong>Loeschen</strong></a></td>"
,
"delete.php"
,
$file
);
printf (
"<td><a href=\"%s?file=%s\"><strong>Umbenennen</strong></a></td>"
,
"rename.php"
,
$file
);
}
echo
"</table>"
;
}
?>
<div id=
"cleardiv"
>
</div>
</div>
<hr>
<form action=
"upload.php"
method=
"POST"
enctype=
"multipart/form-data"
>
<input type=
"file"
name=
"upfile"
>
<input type=
"submit"
value=
"Hochladen"
>
</form>
<center>
<div id=
"footer"
>
<center>
<hr>
UploadFiles V1.1 Copyrigth 05.2005 by Gabriele Hoevel</CENTER>
</div>
</body>
</html>