![]() |
Re: [PHP]ftp_get will nicht so wie ich es will
Es hat mal wieder nicht jeder das Kleingedruckte gelesen. ;) Ich habe doch oben geschrieben, dass ich vergessen hatte eine Verbindung aufzubauen.
|
Re: [PHP]ftp_get will nicht so wie ich es will
ich dachte, du hättest danach geschrieben, es ginge doch nicht? tippfehler waren auf jeden fall drin....
oder bin ich (not(nicht jeder)) ? ;) |
Re: [PHP]ftp_get will nicht so wie ich es will
Du hast es nicht anders gewollt ... :mrgreen: :???:
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:
... und die bist sicher, dass move_uploaded_file bei dir nicht funktioniert?
<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> |
Re: [PHP]ftp_get will nicht so wie ich es will
Zitat:
|
Re: [PHP]ftp_get will nicht so wie ich es will
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 ![]() // Nachtrag: ![]() |
Re: [PHP]ftp_get will nicht so wie ich es will
ja, meine ich....
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:14 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz