Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP und FTP

Empfohlene Antworten

Veröffentlicht

Hallo,

ich kann mit PHP über FTP Dateien auf einem Server ablegen.

Doch wie kann ich sie wieder löschen?

Ich bekomme bei unten stehendem Script folgende Fehlermeldung:

Warning: ftp_delete(): DELE: missing arguments in /www/htdocs/s/deldatei.php on line 60

**************************

$ftp_server="www.x";

$ftp_user_name="s";

$ftp_user_pass="a";

$user=$ftp_user_name;

// Herstellen der Basis-Verbindung

$conn_id = ftp_connect("$ftp_server");

// Einloggen mit Benutzername und Kennwort

$login_result = ftp_login($conn_id, "$ftp_user_name", "$ftp_user_pass");

// Verbindung überprüfen

if ((!$conn_id) || (!$login_result)){

echo "Ftp-Verbindung nicht hergestellt!<br>";

echo "Verbindung mit $ftp_server als Benutzer $user nicht möglich<br>"; die;

}

else {

$ftp_dir=ftp_pwd($conn_id);

echo "Verbunden mit $ftp_server als Benutzer $user <br>";

}

//Wechsel in das Verzeichnis docs

ftp_chdir ($conn_id, "docs");

// Die Datei $datei wird per Aufruf übergeben.

ftp_delete ($conn_id, $datei);

//auch bei : ftp_delete ($conn_id, "$datei"); tritt der fehler auf

// Schließen des FTP-Streams

ftp_quit($conn_id);

Vielen Dank für die Hilfe!

Gruß Walter

Bist du dir ganz sicher, dass $datei nicht leer ist? Wie übergibst du diese Variable? Hast du an $_GET[] bzw. $_POST[] gedacht?

Ja, dass ein dateiname übergeben wird, habe ich sicher gestellt.

Das habe ich mehrmals getestet.

Danke!

Gruß Walter

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.