+ Antworten
Ergebnis 1 bis 10 von 10

Thema: online upload ... ich verstehs net ...

  1. #1
    TP-Veteran pauel hilft, wo's geht pauel hilft, wo's geht Avatar von pauel
    Registriert seit
    Jan 2003
    Ort
    München
    Beiträge
    1.728

    online upload ... ich verstehs net ...

    hi folks,

    hier mein problem:

    ich schreibe ein Backend in dem man Fotos auf den Server laden kann,
    doch irgendwie werden die immer in das grundverzeichniss in dem die index.php liegt kopiert also in diesem falle galerie...

    hier der code:


    PHP-Code:
    <? 
    if (isset ($_POST['submit']) ) {

      
    $pfad "/home/www/web9/html/klasse/galerie/".$_POST['cat']."/";
      
    copy ($file$pfad.$file_name);
      
      echo 
    "Die datei:".$file_name."wurde erfolgreich in /galerie/".$_POST['cat']." kopiert!";
    }
    else {
    ?>
    <form action="<? echo $PHP_SELF ?>" method="post" ENCTYPE="multipart/form-data">
    <input type="hidden" name="MAX_FILE_SIZE" value="2097152"> 
    <table align="center" cellpadding="0" border="0">
      <tr>
        <td><strong>Foto oder Film Upload:</strong></td>
      </tr>
      <tr>
        <td>
          <table cellpadding="0" cellspacing="0" border="0">
            <tr>
              <td>Kategorie:</td>
              <td>
    <select name="cat" type="list">
    <option value="sonstiges">Sonstiges</option>
    <option value="7fahrt">7.Klassfahrt</option>
    <option value="8fahrt">8.Klassfahrt</option>
    <option value="proben">Proben</option>
    <option value="8klass">8.Klassvorstellungen</option>
    <option value="filme">Film Archiv</option>
    </select>
              </td>
            </tr>
            <tr>
              <td colspan="2"><br /></td>
            </tr>
            <tr>
              <td colspan="2">Datei Auswählen:</td>
            </tr>
            <tr>
              <td colspan="2"><input type="file" name="file"></td>
            </tr>
            <tr>
              <td colspan="2"><input type="submit" value="Datei senden..." name="submit"></td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    </form>
    <?
    }
    ?>

    hoffe auf eure hilfe.

    Pauel

  2. #2
    TP-Veteran Flow09 ist auf einem guten Weg Avatar von Flow09
    Registriert seit
    Jun 2001
    Ort
    Wien
    Beiträge
    1.436
    Stimmt den der Wert in der $_POST['cat'] Variable????

    lg
    Flow
    Lesser known Programming Languages #13: SLOBOL
    ... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.

  3. #3
    TP-Veteran pauel hilft, wo's geht pauel hilft, wo's geht Avatar von pauel
    Registriert seit
    Jan 2003
    Ort
    München
    Beiträge
    1.728
    ja, das sollte das hier sein, also ich will das man die kategorien auswählen kann:

    <select name="cat" type="list">
    <option value="sonstiges">Sonstiges</option>
    <option value="7fahrt">7.Klassfahrt</option>
    <option value="8fahrt">8.Klassfahrt</option>
    <option value="proben">Proben</option>
    <option value="8klass">8.Klassvorstellungen</option>
    <option value="filme">Film Archiv</option>
    </select>

    lg

  4. #4
    TP-Veteran Flow09 ist auf einem guten Weg Avatar von Flow09
    Registriert seit
    Jun 2001
    Ort
    Wien
    Beiträge
    1.436
    Also bei mir funktioniert es!!!
    Habs auf meinem lokalen Apache ausprobiert und hatte kein Problem!

    lg
    Flow
    Lesser known Programming Languages #13: SLOBOL
    ... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.

  5. #5
    Rea
    Rea ist offline
    TP-Lady-Mod Rea lebt für das TP und seine User Rea lebt für das TP und seine User Rea lebt für das TP und seine User Rea lebt für das TP und seine User Rea lebt für das TP und seine User Rea lebt für das TP und seine User Rea lebt für das TP und seine User Rea lebt für das TP und seine User Rea lebt für das TP und seine User Avatar von Rea
    Registriert seit
    Nov 2001
    Ort
    muc
    Beiträge
    8.706
    Hab's auch gerade mal nachvollzogen, bei mir geht es ebenfalls
    einwandfrei!



  6. #6
    TP-Veteran pauel hilft, wo's geht pauel hilft, wo's geht Avatar von pauel
    Registriert seit
    Jan 2003
    Ort
    München
    Beiträge
    1.728
    arg, scheisse wieso bei mir nicht ?
    irgendwie will mir das das zeug dann nicht in der right ordner stecken ...

  7. #7
    TP-Veteran Flow09 ist auf einem guten Weg Avatar von Flow09
    Registriert seit
    Jun 2001
    Ort
    Wien
    Beiträge
    1.436
    Solche Probleme kenn ich (leider)!
    Schau mal ob der Pfad auch der wirklich richtige ist!
    Check mal die php.ini und httpd.conf ob alle Einstellungen so sind wie Sie sein sollen, usw. !!
    Oft liegt dort irgendwo der Hund begraben!
    Das ist das einzige was ich Dir noch raten kann.
    Am Script sollte es nicht liegen da es ja von zwei externen Quellen erfolgreich getestet wurde!

    lg
    Flow
    Lesser known Programming Languages #13: SLOBOL
    ... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.

  8. #8
    TP-Veteran Flow09 ist auf einem guten Weg Avatar von Flow09
    Registriert seit
    Jun 2001
    Ort
    Wien
    Beiträge
    1.436
    Also ich habs jetzt auf Windows und auf Unix getestet und es funktioniert!
    Die Zugriffsrechte für die Ordner könntest Du auch noch checken!

    lg
    Flow
    Lesser known Programming Languages #13: SLOBOL
    ... Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.

  9. #9
    TP-Veteran pauel hilft, wo's geht pauel hilft, wo's geht Avatar von pauel
    Registriert seit
    Jan 2003
    Ort
    München
    Beiträge
    1.728
    hm, okay, warte mal. an die httpd.conf und php.ini komm i net ran!

    Also, dann mal sehen was sich da machen lässt. werde euch auf dem laufenden halten

  10. #10
    TP-Specialist mike bringt sich richtig ein Avatar von mike
    Registriert seit
    Jan 2002
    Ort
    TP/Dynamik
    Beiträge
    2.876
    schau dir mal die funktion
    move_uploaded_file()
    an. könnte die bessere Wahl für dich sein.
    Beschreibung & Anwendungsbeispiel findest unter php.net
    Gehelft? Hier kannst du dich bedanken.

    mike

+ Antworten

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

     

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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51