file upload

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • file upload

    ich versuche mit nem scriptchen files hochzuladen, jedoch check ich dass mit den 2dimensionalen variablen nicht.

    kann sich jemand mal bitte den code ansehen?
    danke vielmals

    PHP-Code:
    mkdir($dir."files/") or die ("");
    $target_path $dir."files/";

    $target_path $target_path basename$_FILES['uploadedfile']['name']);

    if(
    move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
         echo 
    "The file "basename$_FILES['uploadedfile']['name']). " has been uploaded";
    } else{
         echo 
    "There was an error uploading the file, please try again!";


  • #2
    Welche Fehlermeldungen?
    h.a.n.d.
    Schmalle

    http://impressed.by
    http://blog.schmalenberger.it



    Wichtige Anmerkung: Ich habe keine Probleme mit Alkohol ...
    ... nur ohne :-)

    Kommentar


    • #3
      Notice: Undefined index: uploadedfile in c:\Inetpub\wwwroot\ework.php on line 24

      Notice: Undefined index: uploadedfile in c:\Inetpub\wwwroot\ework.php on line 26
      There was an error uploading the file, please try again!

      ist die fehlermeldung, es gibt jedoch noch mer code vor dem teil, es betrifft also volgende zwei zeilen.

      PHP-Code:
      $target_path $target_path basename$_FILES['uploadedfile']['name']);

      if(
      move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) 

      Kommentar


      • #4
        wie sieht denn dein Form Tag aus?
        h.a.n.d.
        Schmalle

        http://impressed.by
        http://blog.schmalenberger.it



        Wichtige Anmerkung: Ich habe keine Probleme mit Alkohol ...
        ... nur ohne :-)

        Kommentar


        • #5
          form tag?

          sry bin etwas neu auf dem gebiet. bin gerade auch an einem php kurs drann, aber bis jezt war alles nur einsteiger muell (wie funktioniert der webserver etc)

          Kommentar


          • #6
            Wie kann man sich an PHP versuchen, wenn man nicht einmal HTML kann? :dnotknow: Lesen: http://de.selfhtml.org/html/formulare/index.htm
            h.a.n.d.
            Schmalle

            http://impressed.by
            http://blog.schmalenberger.it



            Wichtige Anmerkung: Ich habe keine Probleme mit Alkohol ...
            ... nur ohne :-)

            Kommentar


            • #7
              ok html bin ich absoluter crack
              bin auch in jsp, action script etc recht begabt

              ist nur php dass fuer mich neu ist


              jez weis ich auch erst was du meinst...
              ich war zuser aufs php fixiert

              PHP-Code:
              $subject $_POST['subject'];
              $date $_POST['date'];
              $todo $_POST['todo'];
              $uploadedfile $_POST['uploadedfile']; 
              Zuletzt geändert von eniGM@dMiN; 02.09.2005, 10:55.

              Kommentar


              • #8
                ich weiss noch immer nicht, wie Dein Form Tag aussieht. Und was soll das da: $uploadedfile = $_POST['uploadedfile'];???

                Du meinst wohl $_FILES['uploadfile']['tmp_name']; ?!?

                mach mal print_r($_FILES);
                h.a.n.d.
                Schmalle

                http://impressed.by
                http://blog.schmalenberger.it



                Wichtige Anmerkung: Ich habe keine Probleme mit Alkohol ...
                ... nur ohne :-)

                Kommentar


                • #9
                  <form name="eworkform" action="ework.php" method="post">

                  <table border="0" cellspacing="0" cellpadding="0">
                  <tr><td width="70"></td> <td></td></tr>

                  <tr><td> File:
                  </td><td> <input type="hidden" name="MAX_FILE_SIZE" value="100000">
                  <input name="uploadedfile" type="file">
                  </td></tr>


                  <tr><td></td><td align="right">
                  <BR><input type="submit" name="submit" value=" &nbsp; &nbsp; GO! &nbsp; &nbsp; "></td></tr>

                  </table>
                  </form>




                  und bei print_r($_FILES);
                  krig ich nur array() zurueck

                  Kommentar


                  • #10
                    soviel zum Thema HTML Crack *lol*

                    think about enctype
                    h.a.n.d.
                    Schmalle

                    http://impressed.by
                    http://blog.schmalenberger.it



                    Wichtige Anmerkung: Ich habe keine Probleme mit Alkohol ...
                    ... nur ohne :-)

                    Kommentar


                    • #11
                      dann sag mir mal wieso?

                      Kommentar


                      • #12
                        Du lädst das Bild zwar an den Server, sagst ihm aber nicht, dass er es auch verarbeiten soll. Denn Dein Fortmular sendet "offiziell" nur Text bzw. Array aber keine Dateien!
                        h.a.n.d.
                        Schmalle

                        http://impressed.by
                        http://blog.schmalenberger.it



                        Wichtige Anmerkung: Ich habe keine Probleme mit Alkohol ...
                        ... nur ohne :-)

                        Kommentar


                        • #13
                          aha, ok

                          und wie wuerde ich dass machen?

                          Kommentar


                          • #14
                            enctyle hilft nicht wirklich so, hab es damit versucht aber es kommt immernoch der selbe fehler

                            Kommentar

                            Lädt...
                            X