Re: FTP PUT

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

« previous php.general (#147049) next »