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 Datei prüfen

Empfohlene Antworten

Veröffentlicht

Hy,

Ich möchte mittles PHP einen FTP-Ornder auslesen. Es sollen aber nur die Dateien angezeigt werden.

//Auslesen der Dateien aus dem aktuellem Verzeichnis

$folder = @ftp_pwd($conn_ftp);

$liste = @ftp_nlist($conn_ftp, $folder);

for($i=2;$i<4;$i++){

echo "<option>";

if (is_file($liste[$i])) echo $liste[$i];

else echo "Datei existiert nicht";

echo "</option>";

}

Bei mir gibt is_file nur leider nicht die Dateien aus. Ich komme nur zum richtigem Ergebniss, wenn ich es so mache:

!is_file

genau das gleiche ist mit:

!file_exists

Wer weiß rat? Und wie immer danke schon im vorraus.

brixxie

Diese Funktion arbeitet nicht mit entfernten Dateien; der Zugriff auf die zu prüfende Datei muss über das Dateisystem des Servers erfolgen.

Du kannst aber die größe per ftp ermittel, und wenn die 0 ist, dann ist es ein Ordner ....

Ich weiß nicht warum die das noch nicht geändert haben ...

MfG Spoom

Hi,

[ups Link kaputt...]

MfG

Aber jetzt:

ftp_nlist gibt doch ohnehin nur Dateien zurück,

versuch aber mal ftp_rawlist()

FTP rfc:

"NAME LIST (NLST)

This command causes a directory listing to be sent from

server to user site. The pathname should specify a

directory or other system-specific file group descriptor; a

null argument implies the current directory. The server

will return a stream of names of files and no other

information. The data will be transferred in ASCII or

..... "

Laut PHP - Bugliste gibt es aber einen Fehler mit wu-ftpd 2.5.0, der gibt bei nlist auch die Verzeichnisse zurück.

MfG

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.