Hallo leute!
habe folgendes problem:
ich möchte ein script schreiben, in dem eine bild-datei ins dateisystem
übernommen wird.
hier jedoch einmal als thumb (eigener Thumb-Ordner) und einmal als original(anderer ordner).
aber es funtz net so wie i will!!!! es wird entweder nur das original oder das thumb kopiert!!
warum he!?!?!?
hier mein script, damit mein problem deutlicher wird:
<body>
<form name="Form_pictureupload" enctype="multipart/form-data" method="post" action="">
<input type="file" name="file" accept="image/*"> <input name="submit" type="submit" value="Upload">
</form>
</body>
</html>
danke schon im voraus!
lg
paul
habe folgendes problem:
ich möchte ein script schreiben, in dem eine bild-datei ins dateisystem
übernommen wird.
hier jedoch einmal als thumb (eigener Thumb-Ordner) und einmal als original(anderer ordner).
aber es funtz net so wie i will!!!! es wird entweder nur das original oder das thumb kopiert!!
warum he!?!?!?
hier mein script, damit mein problem deutlicher wird:
<body>
PHP-Code:
<?
if (isset($_FILES['file']))
{
$accept_file_types = "(jpg|jpeg|gif|bmp|png)";
$startname = $_FILES["file"]["tmp_name"];
$pictureName = $_FILES["file"]["name"];
$thumbName = "thumb_" . $_FILES["file"]["name"];
$bn = basename($_FILES["file"]["name"]);
echo "Basename: $bn<br />";
$picturePath="./Bilder/".time()."-".$bn;
$thumbPath="./Thumbs/".time()."-"."thumb_".$bn;
if(preg_match("/\." . $accept_file_types . "$/i", $_FILES["file"]["name"]))
{
echo "<font color=\"#00CC00\"><b>Dateityp OK</b></font><br />";
echo "PicturePath: $picturePath<br />PictureName: $pictureName<br />ThumbPath: $thumbPath<br />ThumbName: $thumbName<br />";
if (@move_uploaded_file ($startname, $thumbPath))
{
echo "<font color=\"#00CC00\"><b>Thumb erfolgreich übernommmen!</b></font><BR>";
}
else
{
$error=$_FILES['file']["error"];
echo "<font color=\"#FF0000\"><b>Thumb nicht übernommen: $error</b></font><BR>";
}
if (@move_uploaded_file ($startname, $picturePath))
{
echo "<font color=\"#00CC00\"><b>Bild erfolgreich übernommmen!</b></font><BR>";
}
else
{
$error=$_FILES['file']["error"];
echo "<font color=\"#FF0000\"><b>Bild nicht übernommen: $error</b></font><BR>";
}
}
else
echo "<font color=\"#FF0000\"><b>ungültiger Dateityp</b></font><br />";
}
?>
<input type="file" name="file" accept="image/*"> <input name="submit" type="submit" value="Upload">
</form>
</body>
</html>
danke schon im voraus!
lg
paul
Kommentar