Hallo Community ,
Das Bild wird geuploadet aber kein Thumb erstellt .
Ich habe ebend ImageMagic auf meinem Root Server installiert und weiss nicht,
ob es nun an dem Script liegt oder an einer falschen installation. Ich danke für Hilfe.
Der Upload
Das Bild wird geuploadet aber kein Thumb erstellt .
Ich habe ebend ImageMagic auf meinem Root Server installiert und weiss nicht,
ob es nun an dem Script liegt oder an einer falschen installation. Ich danke für Hilfe.
PHP-Code:
<?
// Start config
$db_host = localhost; # Database Host
$db_user = ***; # Database User
$db_pass = ***; # Database Pass
$db = test; # Database Name
$purge = 0; # delete from DB after X days NOT ACTIVE YET
$purge_days = 14; # delete after 14 days NOT ACTIVE YET
$script_path = "/srv/www/web1/html/upload"; # path to the upload script
$upload_path = "/data"; # name of the data path
$size = 2000000; # max filesize
$admin_email = 1; # send mail to admin after upload
$admin_adress = addslashes("your@email.adress"); # admin email adress
$url = "www.max-3d.de/upload"; # where am i?
$thumb = 1; # create thumbnail?
$convert = "/usr/local/bin/convert"; # path to convert from imagemagick
// End config, dont edit the variables
$date = date("d.m.Y");
$tag = date("d");
$monat = date("m");
$jahr = date("y");
$unixtime = mktime($sekunde, $minute, $stunde, $tag, $monat, $jahr);
$filename1_name1 = md5($unixtime);
$ip = getenv("REMOTE_ADDR");
?>
PHP-Code:
<?
include("config.inc.php");
echo "<html>";
echo "<head>";
echo "<link rel=\"stylesheet\" type=\"text/css\"
media=\"screen\" href=\"style.css\" />";
if ($filename1=="") {
echo "No File selected";
}
if ($_FILES['filename1']['size'] > $size){
echo "File is too large. Max Filesize $size bytes. Your size was ";
print_r($_FILES['filename1']['size']);
echo "<br /><a href=\"javascript:history.back()\">zurück</a>";
} else {
if(eregi("image",$_FILES['filename1']['type'])) {
$type= explode("/", $_FILES['filename1']['type']);
copy($filename1,$script_path."/".$upload_path."/".$filename1_name1.".".$type[1]);
$filename = $filename1_name1.".".$type[1];
mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db($db);
$result = mysql_query("INSERT INTO upload
(name,fileid,type,date,unixtime,ip)
VALUES
('$filename1_name1".".$type[1]',
'$filename1_name1',
'$type[1]','$date',
'$unixtime','$ip')");
echo "Direct Link <form>
<input type=text name=TextFenster size=70
value=http://$url/?id=$filename1_name1>";
echo "<input type=button value=\"Select\"
onclick=\"javascript:this.form.TextFenster.focus();
this.form.TextFenster.select();\"></form>";
echo "Direct Image Link<form><input type=text name=TextFenster
size=70 value=http://$url/data/$filename>";
echo "<input type=button value=\"Select\"
onclick=\"javascript:this.form.TextFenster.focus();
this.form.TextFenster.select();
\"></form>";
if ($_POST['thumb']==on) {
passthru("$convert -thumbnail 320 $script_path/$upload_path/$filename
$script_path/$upload_path/thumb_$filename");
echo "BBCode <form><input type=text name=TextFenster size=70 value=\"
[url=$url/?id=$filename1_name1][img]http://$url/$upload_path/thumb_$filename [/img][/url]\">";
echo "<input type=button value=\"Select\"
onclick=\"javascript:this.form.TextFenster.focus();
this.form.TextFenster.select();\"></form><br />";
echo "<img src=\"http://$url/$upload_path/thumb_$filename\">";
}
} else {
echo "Only images are accepted";
}
}
if ($admin_email==1) {
mail($admin_adress,"New Upload","A new upload at
[url]http:/[/url]$url/?id=$filename1_name1");
}
echo "</body>";
echo "</html>";
?>
Kommentar