hi everyone,
i am having a problem while connecting to a particular server where i have to transfer the files the code works everywhere else but with this ftp it gives me warning as follows,
Warning: ftp_login() expects parameter 1 to be resource, boolean given in D:\xam
pp\htdocs\ews\projects\whatever-tiff\vanguard\stage\batch-upload.php on line 26
FTP connection not established!
One thing that when i tried to connect it VIA CUTEFTP it did not connected until i specified the PROTOCOL TYPE =FTP WITH TLS/SSL (PORT 990 - Implicit)
here is the code that is working perfectly -
include("includes/config-batch.php");
-
include("includes/ftp.trans.php");
-
$myFtp=new Ftp();
-
-
/*BATCH UPLOAD PROCESS*/
-
-
// --------------------------------------------------------------------
-
// THE TRIGGER
-
// --------------------------------------------------------------------
-
-
// set the various variables
-
$myFtp->ftproot = "/Folder1/Sub-folder/hbw/";
-
$myFtp->srcroot = "D:/xampp/htdocs/ews/projects/whatever-tiff/";
-
-
// connect to the destination FTP & enter appropriate directories both locally and remotely
-
$myFtp->ftpc = ftp_connect("sslftp.nyc.gov");
-
$myFtp->ftpr = ftp_login($myFtp->ftpc,"user","pass");
-
-
if((!$myFtp->ftpc) || (!$myFtp->ftpr)) {
-
echo "FTP connection not established!\r\n"; die();
-
}else{echo "FTP connection established!\r\n";}
-
if (!chdir($myFtp->srcroot)) {
-
echo "Could not enter local source root directory.\r\n"; die();
-
}else{echo "Entered local source root directory!\r\n";}
-
if(!ftp_chdir($myFtp->ftpc,$myFtp->ftproot)) {
-
echo "Could not enter FTP root directory.\r\n"; die();
-
}else{echo "Entered FTP root directory!\r\n";}
-
return;
-
// start ftp'ing over the directory recursively
-
$res=$myFtp->getBatchFiles($conn);
-
echo $res."\r\n";
-
if($res){
-
echo "All File(s)transffered\r\n";
-
}else{
-
//echo "The File(s) could not be transferred to the remote location \r";
-
echo "There are no File(s) to be transferred to the remote location \r\n";
-
}
-
-
// close the FTP connection
-
ftp_close($myFtp->ftpc);
-
echo "Operation Completed.....Exiting Now\r\n";
-
5 3381 - $myFtp->ftpc = ftp_connect("sslftp.nyc.gov");
must be returning false
Yes it is returning False, what could it be ....something to do with the hosting end ..??..although it is connected via CUTEFTP...i even tried specifying the port num also
like 21,22,24,990 ,but it is always returning false.
regards,
Omer Aslam.
21,22,24,990
This is not the port number it is the ip address.
Should be '.' not ',' and needs to be in quotes also - ftp_connect('21.22.24.990')
Test port with - fopen('ftp://21.22.24.990') or http://...
Is the port number definitely 21?
lol no Green i was trying to tell that i have tried different combinations of the port for the port parameter in ftp_connect like the following -
$myFtp->ftpc = ftp_connect("sslftp.nyc.gov",21);
-
-
$myFtp->ftpc = ftp_connect("sslftp.nyc.gov",22);
-
-
$myFtp->ftpc = ftp_connect("sslftp.nyc.gov",24);
-
-
$myFtp->ftpc = ftp_connect("sslftp.nyc.gov",990);
-
-
i surely am not that MoNkEy to do such a mistake Green :D , but may be the typo made you think like that , hope you get what i was trying to tell ...i havenot tried to specify the port number before , as it embeds the 21 as the parameter for port number automatically if not specified
regards,
Omer Aslam
I have found using DNS to be unreliable with ftp_connect().
So persevere using 21.22.24.990.
Test this with cuteFTP. Is it correct?
I have never needed to define port 21.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Google Mike |
last post by:
After a lot of thought and research, and playing with FreeTDS and
InlineTDS, as well as various ODBC connections, I have determined that
the fastest and cheapest way to get up and going with PHP on...
|
by: Ramir Santos |
last post by:
my analysis server is hosted on a win2k server with IIS, the hosting page is
on another machine. I have followed everything as per MS KB article and I
could not connect through the analysis server...
|
by: TP |
last post by:
Hi,
This is probably my 7th post of the day. not spamming, just want to
get the questions out, so that I can find the answers and post them
back or some good soul can help me out.
Right now I...
|
by: Ann Marinas |
last post by:
Hi all,
I would like to ask for some help regarding separating the asp.net
webserver and the sql server.
I have created an asp.net application for a certain company. Initially,
we installed...
|
by: Jeremy Dillinger |
last post by:
I am trying to design a program that will use data from a MySQL database.
Currently all the data is being used with PHP scripts from a website. I am
also trying to build a software solution that...
|
by: NewsReader |
last post by:
Hello,
I have been looking around the net for a script to help me connect to and
help gather information from Cisco routers/switches. I have pieced together
a couple of different scripts from...
|
by: cj.snead |
last post by:
Hello,
I am having trouble connecting to a remote named instance of SQL Server
via Pocket PC. I have had absolutely no luck connecting with VS 2005
(even to a default instance), so I wen't back...
|
by: =?Utf-8?B?R2lkaQ==?= |
last post by:
Hi,
I've my win32 application which connecting to my sql database.
till now i used MSDE as my database and now i want to upgrade to sql express
2005. after the upgrade i tried to connect to the...
|
by: mairhtin o'feannag |
last post by:
Hello,
I'm having problems connecting to my new v9 db box. The pertinent
information is below:
DB2_db2inst1 60000/tcp
DB2_db2inst1_1 60001/tcp
DB2_db2inst1_2 60002/tcp
DB2_db2inst1_END...
|
by: aboutjav.com |
last post by:
Hi,
I need some help. I am getting this error after I complete the asp.net
register control and click on the continue button. It crashed when it
tries to get
it calls this Profile property
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |