PHP-Code:
<?
error_reporting(E_ALL);
if(!empty($_POST['action'])){
$path = "uploads/"; // Url zum Speicher Ordner
$filename = "wichsfr0sch_";
$deindomain = "www.wichsfr0sch.de/";
$time=time();
if ($_FILES['userfile']['tmp_name']<> 'none')
{
$file = $_FILES['userfile']['name'];
$temp = $_FILES['userfile']['tmp_name'];
$path_parts = pathinfo($file);
$filename = "wichsfr0sch_" . $time . "." . $path_parts["extension"];
$dest = $path.$filename;
move_uploaded_file($temp, $dest);
echo "Die Datei ist auf dem Server! <br><br>";
echo "Url der Datei: <a href=\"$deindomain$path$filename\" target=\"_blank\">".$deindomain.$path.$filename;
echo "</a>";
}
} else { ?>
<form method="post" enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<input type="hidden" name="MAX_FILE_SIZE" value="500000">
<br>
<strong>File Upload</strong> <br>
<br>
<input name="userfile" type="file" size=40>
<br>
<br>
<input type="submit" name="action" value="Speichern">
</form><? } ?>
Kommentar