AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein [PHP]ftp_get will nicht so wie ich es will
Thema durchsuchen
Ansicht
Themen-Optionen

[PHP]ftp_get will nicht so wie ich es will

Ein Thema von Luckie · begonnen am 3. Nov 2005 · letzter Beitrag vom 4. Nov 2005
Antwort Antwort
Seite 3 von 3     123   
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#21

Re: [PHP]ftp_get will nicht so wie ich es will

  Alt 4. Nov 2005, 12:31
Es hat mal wieder nicht jeder das Kleingedruckte gelesen. Ich habe doch oben geschrieben, dass ich vergessen hatte eine Verbindung aufzubauen.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
Benutzerbild von DGL-luke
DGL-luke

Registriert seit: 1. Apr 2005
Ort: Bad Tölz
4.149 Beiträge
 
Delphi 2006 Professional
 
#22

Re: [PHP]ftp_get will nicht so wie ich es will

  Alt 4. Nov 2005, 13:11
ich dachte, du hättest danach geschrieben, es ginge doch nicht? tippfehler waren auf jeden fall drin....

oder bin ich (not(nicht jeder)) ?
Lukas Erlacher
Suche Grafiktablett. Spenden/Gebrauchtangebote willkommen.
Gotteskrieger gesucht!
For it is the chief characteristic of the religion of science that it works. - Isaac Asimov, Foundation I, Buch 1
  Mit Zitat antworten Zitat
Benutzerbild von Flocke
Flocke

Registriert seit: 9. Jun 2005
Ort: Unna
1.172 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#23

Re: [PHP]ftp_get will nicht so wie ich es will

  Alt 4. Nov 2005, 13:32
Du hast es nicht anders gewollt ...

Dieser Code läuft eigentlich so fast auf jedem Webserver mit PHP und lädt eine Datei in das Skriptverzeichnis hoch (sofern dieses unterhalb von DOCUMENT_ROOT liegt, ansonsten müsste man einen Spezialfall behandeln).

Code:
<html>
<head>
<title>File based form upload test</title>
</head>
<body>
<?php
   if (count($_FILES))
   {
      echo "<h1>Result</h1>\n";
      echo "<pre>\$_FILES = " . htmlspecialchars(print_r($_FILES, true)) . "</pre>\n";

      if (!empty($_POST['versch']))
      {
         $rp = dirname($_SERVER['PHP_SELF']) . '/';
         foreach ($_FILES as $file)
            if (!empty($file['name']))
            {
               $target = str_replace('//', '/',
                  $_SERVER['DOCUMENT_ROOT'] . $rp . basename($file['name']));
               $tht = htmlspecialchars($target);
               if (file_exists($target))
               {
                  echo "

File `" . $tht . "´ already exists.</p>\n";
                  if (unlink($target))
                     echo "

Old file `" . $tht . "´ removed.</p>\n";
                  else
                     echo "

Couldn't remove old file `" . $tht . "´.</p>\n";
               }

               if (move_uploaded_file($file['tmp_name'], $target))
                  echo "

Uploaded file was stored as `<a href=\"" .
                     str_replace('//', '/', basename($tht)) . "\">" . $tht . "</a>´.</p>\n";
               else
                  echo "

Uploaded file `" . htmlspecialchars($file['tmp_name']) .
                     "´ could not be moved to `" . $tht . "´.</p>\n";
            }
      }
?>
   <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>" method="get">
   <input type="submit" value=" Noch einmal ">
   </form>
   </div>
<?php
      //phpInfo();
   }
   else
   {
?>
   <h1>Upload</h1>
   <div>
   <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>"
   method="post" enctype="multipart/form-data">
   Filename: <input type="file" name="datei" size="50">


   <input type="checkbox" name="versch">Try `move_uploaded_file´


   <input type="submit" value=" Absenden ">
   </form>
   </div>
<?php
   }
?>
</body>
... und die bist sicher, dass move_uploaded_file bei dir nicht funktioniert?
Volker
Besucht meine Garage
Aktuell: RtfLabel 1.3d, PrintToFile 1.4
  Mit Zitat antworten Zitat
Benutzerbild von DGL-luke
DGL-luke

Registriert seit: 1. Apr 2005
Ort: Bad Tölz
4.149 Beiträge
 
Delphi 2006 Professional
 
#24

Re: [PHP]ftp_get will nicht so wie ich es will

  Alt 4. Nov 2005, 14:17
Zitat von Flocke:
... und die bist sicher, dass move_uploaded_file bei dir nicht funktioniert?
darum gehts doch gar nicht, Flocke. Er programmiert einen WebFTP! und da bringt einem move_uploaded_file herzlich wenig
Lukas Erlacher
Suche Grafiktablett. Spenden/Gebrauchtangebote willkommen.
Gotteskrieger gesucht!
For it is the chief characteristic of the religion of science that it works. - Isaac Asimov, Foundation I, Buch 1
  Mit Zitat antworten Zitat
Benutzerbild von Flocke
Flocke

Registriert seit: 9. Jun 2005
Ort: Unna
1.172 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#25

Re: [PHP]ftp_get will nicht so wie ich es will

  Alt 4. Nov 2005, 14:22
Ich bezog das noch auf den Grund, warum er in dem anderen Thread überhaupt mit FTP anfing - nämlich weil er move_uploaded_file nicht zum funktionieren gebracht hat.

Du meinst also er macht einen "Web-basierten FTP-Client", so wie hier?

// Nachtrag: Bei Google suchenweb-based ftp-client
Volker
Besucht meine Garage
Aktuell: RtfLabel 1.3d, PrintToFile 1.4
  Mit Zitat antworten Zitat
Benutzerbild von DGL-luke
DGL-luke

Registriert seit: 1. Apr 2005
Ort: Bad Tölz
4.149 Beiträge
 
Delphi 2006 Professional
 
#26

Re: [PHP]ftp_get will nicht so wie ich es will

  Alt 4. Nov 2005, 14:30
ja, meine ich....
Lukas Erlacher
Suche Grafiktablett. Spenden/Gebrauchtangebote willkommen.
Gotteskrieger gesucht!
For it is the chief characteristic of the religion of science that it works. - Isaac Asimov, Foundation I, Buch 1
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 3 von 3     123   


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 aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:05 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz