tutorials.de Buch-Aktion 05/2012
ERLEDIGT
NEIN
ANTWORTEN
11
ZUGRIFFE
327
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #1
    Dragon1509 Dragon1509 ist offline Rookie
    Registriert seit
    Oct 2010
    Beiträge
    7
    Hallo Community ....

    ich weis die Frage wurde hier sicher schon 1000 mal gestellt ... aber ich komme trotz herumforschen nicht weiter.

    Hab einige Tuts von Google sowie auch von hier ausprobiert aber nichts klappt.

    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    
    <?php
    $filename="upload.php";
     
    require("./global.php");
     
    $tempname = $_FILES['file']['tmp_name'];  
    $name = $_FILES['file']['name'];
     
       if($_FILES['datei']['size'] <  10240000)
          {
          move_uploaded_file($tempname, "/music/".$name);
          echo "Das Song wurde Erfolgreich hochgeladen";
          }
     
       else
          {
             echo "Fehler";
          }
     
     
     
    eval("\$tpl->output(\"".$tpl->get("upload")."\");");
    ?>

    Das ist mein Script .... Fehlermeldung ist zwar keine, aber er verschiebt mir die Datei nie, das ReLoaden der Seite erfolgt auch zu schnell als das es so aussehen würde, als würde er etwas hochladen.

    Später will ich es noch in die DB schreiben, aber wichtig wäre erstmal das er überhaupt was tut, außer zu schreiben das die Datei hochgeladen wurde. Hoffe ihr könnt mir helfen.
     

  2. #2
    Avatar von Flex
    Flex Flex ist offline (aka Felix Jacobi)
    tutorials.de Moderator
    Registriert seit
    Nov 2001
    Ort
    Wuppertal
    Beiträge
    5.295
    Blog-Einträge
    65
    Und wie sieht das Formular aus?
     
    KIDS Kinderbetreuungsdienst
    Xing

    "When you play the game of thrones, you win or you die. There is no middle ground."
    by Cersei Lannister in "A Game Of Thrones"

  3. #3
    Dragon1509 Dragon1509 ist offline Rookie
    Registriert seit
    Oct 2010
    Beiträge
    7
    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    
    <html>
    <head>
    <title>$master_board_name - Upload</title>
    $headinclude
    </head>
     
    <body id="bg">
    $header
      </table>
      <FORM ACTION="upload.php" METHOD="POST">
    <table align="left" cellpadding=4 cellspacing=0 border=0 bgcolor="{tableinbordercolor}" width="100%">
    <table align="left" cellpadding=4 cellspacing=0 border=0 bgcolor="{tableinbordercolor}" width="60%">
       <tr id="tablea" bgcolor="{tablecolora}">
        <td width="50%"><normalfont><b>Interpret:</b></font></td>
        <td width="50%"><normalfont><input type="text" class="input" name="u_interpret" value="$u_interpret"></font></td>
       </tr>
       <tr id="tableb" bgcolor="{tablecolorb}">
        <td><normalfont><b>Titel:</b></font></td>
        <td><normalfont><input type="text" class="input" name="u_title" value="$u_title"></font></td>
       </tr>
    </table>
    <form enctype="multipart/form-data" action="upload.php" method="post"> 
    <input type="file" name="file"><br> 
    <input type="submit" value="hochladen"> 
    </form>
    </table>
     
      $footer
    </body>
    </html>
     

  4. #4
    Avatar von timestamp
    timestamp timestamp ist offline Mitglied Rubin
    Registriert seit
    May 2010
    Ort
    Marburg
    Beiträge
    1.479
    Ersetze das:
    PHP-Code:
    move_uploaded_file($tempname"/music/".$name); 
    mal durch:
    PHP-Code:
    if( move_uploaded_file($tempname"/music/".$name) )
      echo 
    'Upload erfolgt';
    else{
      echo 
    'Fehler im upload.';
      
    var_dump($_FILES);

     

  5. #5
    Dragon1509 Dragon1509 ist offline Rookie
    Registriert seit
    Oct 2010
    Beiträge
    7
    Fehler im upload.array(0) { }

    habs auch ohne

    Code :
    1
    2
    
       if($_FILES['datei']['size'] <  10240000)
          {

    versucht, gleicher Fehler
     

  6. #6
    Avatar von Flex
    Flex Flex ist offline (aka Felix Jacobi)
    tutorials.de Moderator
    Registriert seit
    Nov 2001
    Ort
    Wuppertal
    Beiträge
    5.295
    Blog-Einträge
    65
    Im Formular Tag hinzufügen:

    Code :
    1
    
    enctype="multipart/form-data"

    Sonst nimmt das Formular keine Datei entgegen.
     
    KIDS Kinderbetreuungsdienst
    Xing

    "When you play the game of thrones, you win or you die. There is no middle ground."
    by Cersei Lannister in "A Game Of Thrones"

  7. #7
    Dragon1509 Dragon1509 ist offline Rookie
    Registriert seit
    Oct 2010
    Beiträge
    7
    ist vorhanden in der tpl datei?!

    Code :
    1
    2
    3
    4
    
    <form enctype="multipart/form-data" action="upload.php" method="post"> 
    <input type="file" name="file"><br> 
    <input type="submit" value="hochladen"> 
    </form>
     

  8. #8
    Avatar von Flex
    Flex Flex ist offline (aka Felix Jacobi)
    tutorials.de Moderator
    Registriert seit
    Nov 2001
    Ort
    Wuppertal
    Beiträge
    5.295
    Blog-Einträge
    65
    Dann hast du aber einen invaliden HTML Quellcode denn das Formular wird bereits in Zeile 10 geöffnet.

    HTML-Code:
      <FORM ACTION="upload.php" METHOD="POST">
     
    KIDS Kinderbetreuungsdienst
    Xing

    "When you play the game of thrones, you win or you die. There is no middle ground."
    by Cersei Lannister in "A Game Of Thrones"

  9. #9
    Dragon1509 Dragon1509 ist offline Rookie
    Registriert seit
    Oct 2010
    Beiträge
    7
    Ja, wie gesagt, ich bin Anfänger, es sollen später ja auch die Information in die Datenbank übertragen werden, deshalb die erste Anbindung an die Upload.php. Wie soll ich dann die Form für den Upload schreiben? Bzw.... es ändert doch nichts daran, das er die Datei nicht hochladet oder?
     

  10. #10
    QUEST08 QUEST08 ist offline Mitglied Gold
    Registriert seit
    Jul 2008
    Beiträge
    178
    Natürlich ändert sich da dran was. Brauchst ja keine 2 Formulare zum versenden, sondern nur eins. Mach das mal so:

    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    
    <body id="bg">
    $header
      </table>
      <form enctype="multipart/form-data" action="upload.php" method="post"> 
    <table align="left" cellpadding=4 cellspacing=0 border=0 bgcolor="{tableinbordercolor}" width="100%">
    <table align="left" cellpadding=4 cellspacing=0 border=0 bgcolor="{tableinbordercolor}" width="60%">
       <tr id="tablea" bgcolor="{tablecolora}">
        <td width="50%"><normalfont><b>Interpret:</b></font></td>
        <td width="50%"><normalfont><input type="text" class="input" name="u_interpret" value="$u_interpret"></font></td>
       </tr>
       <tr id="tableb" bgcolor="{tablecolorb}">
        <td><normalfont><b>Titel:</b></font></td>
        <td><normalfont><input type="text" class="input" name="u_title" value="$u_title"></font></td>
       </tr>
    </table>
    <input type="file" name="file"><br> 
    <input type="submit" value="hochladen"> 
    </form>
    </table>
     

  11. #11
    Dragon1509 Dragon1509 ist offline Rookie
    Registriert seit
    Oct 2010
    Beiträge
    7
    Hey, danke für deine Antwort. Der Broser ladet zwar länger, aber ich bekomme

    Code :
    1
    2
    
     
    Fehler im upload.array(1) { ["file"]=> array(5) { ["name"]=> string(46) "Jeaw_-_Nur_noch_70_Sekunden.mp3" ["type"]=> string(0) "" ["tmp_name"]=> string(0) "" ["error"]=> int(1) ["size"]=> int(0) } }

    raus ... Datei ist auch nicht im Verzeichnis.
     

  12. #12
    QUEST08 QUEST08 ist offline Mitglied Gold
    Registriert seit
    Jul 2008
    Beiträge
    178
    Das liegt wohl an deiner upload.php Datei. Poste diese doch mal.
     

Ähnliche Themen

  1. Antworten: 1
    Letzter Beitrag: 15.09.07, 14:56
  2. HTTP-Dateiupload funktioniert nicht
    Von javaprogger1987 im Forum Java
    Antworten: 0
    Letzter Beitrag: 25.03.07, 12:17
  3. Dateiupload per Formular funktioniert nicht
    Von Papenburger im Forum PHP
    Antworten: 4
    Letzter Beitrag: 13.03.07, 11:50
  4. Antworten: 11
    Letzter Beitrag: 27.08.06, 17:34
  5. Dateiupload funktioniert nicht bei großen Dateien
    Von Nikon the Third im Forum PHP
    Antworten: 3
    Letzter Beitrag: 31.08.04, 11:09

Stichworte