|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Php/ftp Help!
To whome it may concern:
I don't really know where else to turn...I can't find any information on this subject anywhere on the net. I'm developing an ftp driver using PHP, and I have run into some problems. I can log into the server, look at the files, check the time stamps, etc.; however, when I go to download a file, using ftp_get(), the server times out after the default 90 seconds. I know the script attempts to grab the file, because the file shows up on my server with a size of 0 k. I suspect I am having a permissions problem. I changed permissions around and got the script to work eventually. Then I tried downloading another file with the same script and permissions and ran into the same problem. So, I went back to the original working script, and it no longer worked. I didn't even change anything. Also...this happens with any ftp server I attempt to access and transfer files. Finally, I am trying to transfer files from an ftp site to a web server. Do you have any ideas what may be causing this problem? Sincerely, Mark E. Mcewen |
|
#2
|
|||
|
|||
|
I had a similar problem once, I ended up setting the FTP mode to passive which solved the problem.
|
|
#3
|
|||
|
|||
|
RE:
I tried changing the passive mode, but I get an error for that too. It will not allow me to change the mode. Any other suggestions?
|
|
#4
|
|||
|
|||
|
Would it be possible to post the code you're using? This may help determine the problem.
Also, are you specifying the transfer mode (FTP_ASCII / FTP_BINARY)? Here's some more information for you.
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#5
|
|||
|
|||
|
RE:
This is my code in a nutshell. I have a more interesting version that does some other things...but it is useless until I can get this to work...
// login with username and password $login_result = ftp_login($conn_id, "$ftp_user_name", "$ftp_user_pass"); // check connection if ((!$conn_id) || (!$login_result)) { echo "Error: Ftp connection has failed!<BR>"; echo "Attempted to connect to $ftp_server for user $ftp_user_name<BR>"; die; } else { echo "Connected to $ftp_server, for user $ftp_user_name<BR>"; } // download the file $download = ftp_get($conn_id, $localfile, $remotefile, FTP_BINARY); // check upload status if (!$download) { echo "Ftp download has failed!<BR>"; } else { echo "Downloaded $remotefile to $ftp_server as $localfile<BR>"; } // close the FTP stream ftp_quit($conn_id); |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Php/ftp Help! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|