dateien koennen nicht auf server abgelegt werden

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

  • dateien koennen nicht auf server abgelegt werden

    hallo, ich hab mal wieder ein problem.

    ich hab da son uploadscript gebastelt und zusammen gemopst

    naja, aber irgendwie kann ich die ausgewählte datei nicht auf dem server speichern...muss ich da vielleicht irgendwelche besonderen rechte vergeben??? man merke: linux-host

    i hoab doch mal widder keene ahnung

    thx im vorraus

    mfg dennis

  • #2
    gib dem zielverzeichnis mal die rechte 777
    INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


    Kommentar


    • #3
      hab ich ja bereits ... immer noch derselbe fehler...

      Kommentar


      • #4
        wenn es einen übergeordneten order gibt, müsste der ggsl auch auf 777 gestellt sein?

        ist safemode an oder aus?
        INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


        Kommentar


        • #5
          hab alle ordner auf chmod 777 gesetzt...

          safemode ist aus...war es zumindest immer

          Kommentar


          • #6
            code?
            INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


            Kommentar


            • #7
              ich werd den code gleich mal schicken...vorerst muss ich mal kochen...

              Kommentar


              • #8
                also das ist die datei config.php:


                PHP-Code:
                <?
                $absolute_path = "/images"; //Absolute path to where files are uploaded
                $size_limit = "yes"; //do you want a size limit yes or no.
                $limit_size = "512000"; //How big do you want size limit to be in bytes, set to 500kb 1024bytes x 500
                $limit_ext = "yes"; //do you want to limit the extensions of files uploaded
                $ext_count = "4"; //total number of extensions in array below
                $extensions = array(".gif", ".jpg", ".jpeg", ".png"); //List extensions you want files uploaded to be
                ?>

                das die datei index.php (uploadscript):

                PHP-Code:
                <?
                switch($upload) {
                default:
                include "config.php";
                echo "
                <html>

                <head>
                <title>Upload</title>
                </head>

                <body topmargin=\"10\" leftmargin=\"0\" bgcolor=\"#18576F\" link=\"#818EA0\" vlink=\"#5C697A\" alink=\"#818EA0\" text=\"#FFFFFF\" style=\"font-family: Verdana; font-size: 8pt; color: #FFFFFF\">



                <div align=\"center\">
                  <center>
                  <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"400\" id=\"AutoNumber1\">
                    <tr>
                      <td bgcolor=\"#5E6A7B\" height=\"25\">
                      <p align=\"center\"><font size=\"2\"><b>Upload Datei</b></font></td>
                    </tr>
                    <tr>
                      <td bgcolor=\"#818EA0\"><font size=\"2\">Folgende Kriterien muss die hochzuladende Datei erfüllen:</font><ul type=\"square\">
                        <li><font size=\"2\">Datei-Extension muss sein: <b>";
                        if (($extensions == "") or ($extensions == " ") or ($ext_count == "0") or ($ext_count == "") or ($limit_ext != "yes") or ($limit_ext == "")) {
                           echo "Irgendeine Extension";
                        } else {
                        $ext_count2 = $ext_count+1;
                        for($counter=0; $counter<$ext_count; $counter++) {
                            echo "&nbsp; $extensions[$counter]";
                        }
                        }
                        if (($limit_size == "") or ($size_limit != "yes")) {
                            $limit_size = "any size";
                        } else {
                            $limit_size .= " bytes";
                        }
                        echo"</b></font></li>
                        <li><font size=\"2\">Maximale Dateigröße: $limit_size</font></li>
                        <li><font size=\"2\">Keine Leerzeichen im Dateiname</font></li>
                        <li><font size=\"2\">Datei darf keine Sonderzeichen enthalten 
                        (/,*,\,etc)</font><BR>
                        </li>
                      </ul>
                      <form method=\"POST\" action=\"$PHP_SELF?upload=doupload\" enctype=\"multipart/form-data\">
                <p align=\"center\">
                <input type=file name=file size=30 style=\"font-family: v; font-size: 10pt; color: #5E6A7B; border: 1px solid #5E6A7B; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1\"><br>
                <br>
                <button name=\"submit\" type=\"submit\" style=\"font-family: v; font-size: 10pt; color: #5E6A7B; border: 1px solid #5E6A7B; padding-left: 4; padding-right: 4; padding-top: 1; padding-bottom: 1\">Upload</button>
                </p>
                </form>
                      <p>
                </td>
                    </tr>
                  </table>
                  </center>
                </div>


                </body>

                </html>";
                break;
                case "doupload":
                include "config.php";
                $endresult = "<font size=\"2\">Datei hochgeladen</font>";
                if ($file_name == "") {
                $endresult = "<font size=\"2\">Keine Datei ausgewählt</font>";
                }else{
                if(file_exists("$absolute_path/$file_name")) {
                $endresult = "<font size=\"2\">Datei ist bereits vorhanden</font>";
                } else {
                if (($size_limit == "yes") && ($limit_size < $file_size)) {
                $endresult = "<font size=\"2\">Datei ist zu groß</font>";
                } else {
                $ext = strrchr($file_name,'.');
                if (($limit_ext == "yes") && (!in_array($ext,$extensions))) {
                $endresult = "<font size=\"2\">Dateityp ist falsch</font>";
                }else{
                @copy($file, "$absolute_path/$file_name") or $endresult = "<font size=\"2\">Datei konnte nicht auf dem Server gespeichert werden</font>";
                }
                }
                }
                }
                echo "
                <html>

                <head>
                <title>Upload</title>
                </head>

                <body topmargin=\"10\" leftmargin=\"0\" bgcolor=\"#18576F\" link=\"#818EA0\" vlink=\"#5C697A\" alink=\"#818EA0\" text=\"#FFFFFF\" style=\"font-family: Verdana; font-size: 8pt; color: #FFFFFF\">



                <div align=\"center\">
                  <center>
                  <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"400\" id=\"AutoNumber1\">
                    <tr>
                      <td bgcolor=\"#5E6A7B\" height=\"25\">
                      <p align=\"center\"><font size=\"2\"><b>DateiUpload</b></font></td>
                    </tr>
                    <tr>
                      <td bgcolor=\"#818EA0\">
                      <center> $endresult </center>
                    </td>
                    </tr>
                  </table>
                  </center>
                </div>


                </body>

                </html>";
                break;
                }
                ?>
                ich hoffe du kannst mir weiterhelfen...


                edit: hab doch glatt das endetag vergessen

                Kommentar


                • #9
                  aaaaaarg. das sind ja haufenweise anfangsfehler dabei.....

                  copy() nimmt man nicht.

                  auch solltest du das $_FILES array nehmen.

                  schaue dir das mal hier an.....
                  http://de.php.net/manual/de/features.file-upload.php

                  lies dir das mal durch. du musst dann nur noch dein script anpassen...
                  INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


                  Kommentar


                  • #10
                    also ok....ich werde den ganzen SCH***s script nochmal neu schreiben....


                    werd dann das ergebnis nochmal posten und abwarten was ihr dazu sagt





                    mfg dennis

                    Kommentar


                    • #11
                      mach das. aber posten brauchst du es nicht wirklich. im manual ist eigentlich alles gut erklärt, was man(n) wissen muss.
                      INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


                      Kommentar


                      • #12
                        man muss nur wissen, dass es dieses manual gibt

                        ausserdem juckts mich irgendwie, dass da sooooviel englisch drin steht

                        Kommentar


                        • #13
                          jetzt weisst du ja, dass es das manual gibt.

                          ich habe dir doch einen DE link gegeben. es sollte alles in DE sein... wenn nicht, einfach umschalten...

                          aber das englische soll etwas aktueller sein...
                          INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


                          Kommentar


                          • #14
                            Hi,

                            und weiter gehts....

                            Warning: move_uploaded_file() [function.move-uploaded-file]: open_basedir restriction in effect. File(/up.php) is not within the allowed path(s): (/home/www/webxxx/) in /home/www/webxxx/html/up/up.php on line 16

                            Ich kriegs net hin, wo liegt der Fehler?

                            Kommentar


                            • #15
                              du versuchst eine datei namens /up.php zu speichern. / heisst der root des ganzen servers.

                              erlaubt ist für dich aber erst ab /home/www/webxxx/ .

                              das steht doch alles da. aber wer lesen kann ist klar im vorteil...
                              INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


                              Kommentar

                              Lädt...
                              X