FTP PUT
| From: | caspar kennerdale | Date: | Fri, 09 May 2003 17:31:23 +0000 |
| Subject: | FTP PUT | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147046@lists.php.net to get a copy of this message | ||
If someone could help it would be much appreciated. I am tryign to upload a
file to a server with ftp_put.
However I get the following error message-
Warning: ftp_put() [function.ftp-put]: File status okay; about to open data
connection.
A file does get created on the server with my desired name but it is 0 bytes
in size so no file has uploaded. So I know my FTP connection is working.
I used the code in the php manual as a guide, but I do not know where I have
gone wrong.
Here is my code
-Form
echo"<br><br><form name=\"Attachments\" method=POST
action=\"".$_SERVER['PHP_SELF']."?action=Upload\"
enctype=\multipart/form-data\"><input type=file name=SelectFile><input
type=submit value=Submit></form>";
-Upload Function
$DestinationFile = "test.doc";//$file;
$SourceFile = $_REQUEST["SelectFile"];
$Upload = ftp_put($ConId, $DestinationFile, $SourceFile,
FTP_BINARY);
Thanks