#47792 [Opn->Bgs]: I ttryd to upload 1 file to server but the error wil occur

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
 ID:               47792
 Updated by:       [email protected]
 Reported By:      ashraf_ker at yahoo dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         FTP related
 Operating System: windows xp
 PHP Version:      5.2.9
 New Comment:

You need to use ftp_connect to open an ftp resource before attempting
to use any of the ftp functions.


Previous Comments:
------------------------------------------------------------------------

[2009-03-26 17:05:58] ashraf_ker at yahoo dot com

Description:
------------
the error is: 
1). ftp_put() expects parameter 1 to be resource, string given in  
D:\xampp\htdocs\ftp\testftp.php on line 10

2).  ftp_close() expects parameter 1 to be resource, string given in 
D:\xampp\htdocs\ftp\testftp.php on line 15







Reproduce code:
---------------
---
From manual page: faq
---
<?php
	//error_reporting(0);
	$conn_id="ftp.vidhyalokam.com";
	$destination_file="/public_html/test/";
	$source_file="NEWS";
	
	// ftp_pasv( $ftp, 1);

$upload= ftp_put($conn_id,$destination_file,$source_file,FTP_ASCII);
if (!$upload)
{echo"sorry, didn't work.";}
else
{echo"OK!";}
ftp_close($conn_id);

?>

Expected result:
----------------
Expecting that all the files of Directory "NEWS" upload to server in 
"/public_html/test/"



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47792&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.