$filesizebytes = filesize($images3);
und wie man tags benutzt weis ich leider nicht

$images3 enthält bei mir folgendes
/home/www/web75/phptmp/phpwv3UI4
also anscheinend die temporäre datei auf dem server.
das sollte doch auch so richtig sein oder?
$images = "toupload$imCount"."_name";
$images1 = $$images;
$images2 = "toupload$imCount";
$images3 = $$images2;
if($images3 != "none") {
$filesizebytes = filesize($images3);
<?php
$config[files] = "3"; //Number of FikeUploadBoxes
$config[dir] = "../screenshots/"; //!!!!!This Folder has to be created as subfolder!!!!!!!!!!!!!!!
$imagetype="gif";
if (!is_dir("$config[dir]")) die ("Verzeichniss \"$config[dir]\" nicht gefunden.");
$handle=opendir("$config[dir]/");
while ($file = readdir($handle))
{
if ($file=="." or $file=="..")
{} else $filelisting[]="$file";
$imCountber=sizeof($filelisting);
};
$h = 1;
$g=0;
for ($i = 0 ; $i < $imCountber ; $i++)
{
$album[$i] = substr($filelisting[$i],0,strpos($filelisting[$i],"~"));
}
if (isset($album))
{
sort($album);
reset($album);
}
for ($i = 0 ; $i < count($album) ; $i++)
{
$next = $album[$i+1];
if ($next != $album[$i])
{
$alben[$album[$i]] = $h;
$h=1;
}
else $h++;
}
if ($mode == "uploadfile") {
for ($i = 0 ; $i < count($album) ; $i++){
$next = $album[$i+1];
if ($next != $album[$i]) {
$alben[$album[$i]] = $h;
$h=1;
} else {$h++;
}
}
$imCount = 0;
if (isset($alben[$aname]))
$h = $alben[$aname] +1;
else $h=1;
while($imCount < $config[files]) {
$imCount++;
$images = "toupload$imCount"."_name";
$images1 = $$images;
$images2 = "toupload$imCount";
$images3 = $$images2;
if($images3 != "none") {
$filesizebytes = filesize($images3);
if ($filesizebytes ==0) {
$error .= sprintf("Keine Datei ausgewählt<BR>", $images1);
}
elseif ($filesizebytes > 500000) {
$error .= sprintf("Datei %s zu gross (maximale Dateigrösse 0,5 Mb)<BR>", $images1);
}
elseif (file_exists("$config[dir]/$aname~$h.$imagetype")) {
$error .= sprintf("Interner Fehler (%s exisitert bereits));
}
else {
copy ($images3, "$config[dir]/$aname~$h.$imagetype");
$error .= sprintf("Datei %s wurde als $aname~%s.$imagetype hochgeladen.<br>",$images1,$h);
$h++;
$DemoStrg= "screenshot.php?FixtureID=".$aname;
$UpdateScreenshotLink = "UPDATE fixture SET demolink = '".$DemoStrg."' WHERE fixtureid = '".$FixtureID."'";
sql_query($UpdateScreenshotLink);
}
clearstatcache();
}
}
echo("<h3>Upload Result</h3><br>$error\n");
echo "<br><br>\n<a href=\"$PHP_SELF?FixtureID=$aname\">Zurück</a>\n";
exit();
}
$imCount = 0;
while($imCount < $config[files]) {
$imCount++;
$html .= "<tr width=\"25%\"><th align=\"left\" >Screenshot $imCount</th><td width=\"75%\" class=\"list\" align=\"left\">
<input name=\"toupload$imCount\" type=\"file\" size=\"25\" value=\"Durchsuchen\"></td>";
}
?>
<form enctype="multipart/form-data" action="upload.php?FixtureID=<?=FixtureID?>" method="post">
<p>Screenshots als *.<?=$imagetype?> Datei 800x600 uploaden (maximale Dateigrösse 0,5 MB).</p>
<input type="hidden" name="mode" value="uploadfile">
<input type="hidden" name="aname" value="<?=$FixtureID?>">
<table width="450" border="0" cellspacing="0" cellpadding="0">
<tr><td width="100%">
<table width="450" border="0" cellspacing="1" cellpadding="2">
<tr><th colspan="2">Select Files</th></tr>
<?php echo $html; ?>
</table></td></tr>
<tr><td align="center"><input type="submit" value="Upload Files"></td></tr>
</table>
</form>
<?
Einen Kommentar schreiben: