php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2006

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 01.03.2006, 22:58  
Benutzer
 
Registriert seit: 26.08.2005
Beiträge: 66
imported_FlasH
Standard Problem beim Bildupload/ Thumbnailerstellen

Also ich möchte beim Bildupload ein Thumbnail erstellen lassen, bekomme aber nur Fehlermeldungen und weis einfach nicht weiter.

der Bilduploadordner ist das Verzeichnis "images". Der betreffende Codeteil sieht so aus:

Code:
   case "bilder":
    if (isset($_POST['submit']))
    {
       // Temporäres File & FileSize in KB auf keine Kommastelle gerundet
       $file_temp = $_FILES['file']['tmp_name'];
       $file_size = round($_FILES['file']['size']/1024);

       // Neuer Dateiort
       $where_to = "./images/".$_FILES['file']['name'];
       $imgpath = "images/".$_FILES['file']['name'];
       $newpath = "images/thumb_".$_FILES['file']['name'];

       // Dateiname
       $file_name = $_FILES['file']['name'];
       move_uploaded_file($file_temp, $where_to);
	   
	   //Ausgabe
       echo "<table border=1>
       <tr>
       <td colspan=2 align=center>- Uploaded Pic -</td>
       </tr>
       <tr>
       <td>Normal:

       <img src=\"".$imgpath."\" border=0></td>";

       // Thumbnailgenerator
       $src = imagecreatefromjpeg($imgpath);
       $src_b = imagesx($src);
       $src_h = imagesy($src);
       $neue_h = 100;
       $neue_b = $src_b / $src_h * $neue_h;
       $dst = imagecreate($neue_b, $neue_h);
       imagecopyresized($dst, $src, 0, 0, 0, 0, $neue_b, $neue_h, $src_b, $src_h);
       imagejpeg($dst,$newpath);

       echo "<td>Thumbnail

       <img src=\"".$newpath."\" border=0>
       </td></tr></table>";

       mysql_query("INSERT INTO xrf_thumbs VALUES ('','".$_FILES['file']['name']."','thumb_".$_FILES['file']['name']."',DATE_FORMAT(CURDATE(),'%d.%m.%Y'))");
    }
Ich bekomme eine ganze Reihe Fehlermeldungen, aus denen ich nicht schlau werde:

Code:
Warning: imagecreatefromjpeg(): 'images/' is not a valid JPEG file in /srv/www/htdocs/web330/html/jos/admin.php on line 224

Warning: imagesx(): supplied argument is not a valid Image resource in /srv/www/htdocs/web330/html/jos/admin.php on line 225

Warning: imagesy(): supplied argument is not a valid Image resource in /srv/www/htdocs/web330/html/jos/admin.php on line 226

Warning: Division by zero in /srv/www/htdocs/web330/html/jos/admin.php on line 228

Warning: imagecreate(): Invalid image dimensions in /srv/www/htdocs/web330/html/jos/admin.php on line 229

Warning: imagecopyresized(): supplied argument is not a valid Image resource in /srv/www/htdocs/web330/html/jos/admin.php on line 230

Warning: imagejpeg(): supplied argument is not a valid Image resource in /srv/www/htdocs/web330/html/jos/admin.php on line 231
Bitte um Hilfe. Danke schonmal

FlasH
__________________
Admin @ uploadhost.de
imported_FlasH ist offline  
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 01.03.2006, 23:06  
Gast
 
Beiträge: n/a
Standard

Zitat:
Warning: imagecreatefromjpeg(): 'images/' is not a valid JPEG file
Oh, hatten wir das nicht erst hier im Forum.
Naja, dein JPG-Bild wurde nicht als solches erkannt.

Der Rest der Fehler sind Folgefehler bezogen auf den ersten.
 
Alt 02.03.2006, 08:12  
Erfahrener Benutzer
 
Registriert seit: 23.08.2007
Beiträge: 1.510
M3g4Star befindet sich auf einem aufstrebenden Ast
Standard

Zitat:
$_FILES['file']['name']
scheint irgendwie leer zu sein ! Das solltest du nochmal checken ...
M3g4Star ist offline  
 


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
[Erledigt] Galerie Problem... coraplanet PHP Tipps 2008 4 06.06.2008 13:42
Problem mit Bildupload Charly Shop Sui PHP Tipps 2006 2 14.07.2006 12:30
datensätze defekt oder problem mit dem einlesen? Ministry Datenbanken 4 06.07.2006 18:42
Problem mit Bildupload 2wuck PHP Tipps 2006 2 03.07.2006 07:05
problem!!! PHP Tipps 2006 6 08.02.2006 11:06
[Erledigt] wieder ein Problem bei phpmailer und smtp PHP Tipps 2006 24 07.02.2006 01:07
Problem beim Bildupload PHP Tipps 2005-2 2 11.09.2005 19:30
Problem bei Bildupload PHP Tipps 2004-2 4 26.12.2004 00:04
Problem mit Weiterleitung PHP Tipps 2004-2 16 22.12.2004 17:49
Smarty und PHP-Skript Problem PHP Tipps 2004-2 2 03.12.2004 22:27
Problem mit alter JavaScript-Funktion woods PHP Tipps 2004 1 13.08.2004 13:34
Problem: Bildupload und Größenänderung geht nur lokal PHP Tipps 2004 4 08.08.2004 18:00
[Erledigt] Problem mit Timestamp! PHP Tipps 2004 24 08.06.2004 19:51
Login Problem PHP Tipps 2004 4 04.06.2004 18:46
foreach problem mAy^daY PHP Tipps 2004 3 02.06.2004 20:29

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
php bildupload mit thumbnail, php bild upload thumbnail erstellen, $_files not valid, php bildupload thumbnail, alfahosting, advert.creation.error.invalid.image, is not a valid jpeg file, php bildupload mit thumb, thumbnails erstellen mit $_files, flash thumbs erstellen, move_uploaded_file thumb erstellen, php bildupload & thumbnail, php bildupload, php bildupload thumbnails erstellen, bei bild upload thumbnail erstellen php, php thumb $_files, php bild upload und thumb erstellen, bilderupload php mit thumbnail, thumb bilder erstellen php, $_files typ erkennt keine jpg

Alle Zeitangaben in WEZ +1. Es ist jetzt 20:37 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.