Jump to content

Recommended Posts

Hi, I have a script that simply downloads five files from an ftp server.
I do this

[code]$ftp_server = "example.com";
$ftp_user_name  = "username";
$ftp_user_pass = "pass";

// set up basic connection
$conn_id = ftp_connect($ftp_server);


// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

ftp_cdup($conn_id);
ftp_chdir($conn_id, "directory/subdirectory");

$server_file = "serverfile.zip";
$local_file = "localfile.zip";
ftp_get($conn_id, $local_file, $server_file, FTP_BINARY);[/code]

Which was working for a while then now the server seems to be losing my authentication, and it is asking the script to send autentication again, then it doesn't and the script is unable to complete the dowload.

My Question is, is there a way to force that the authentication to the FTP Server stays for the entire time the script runs, or somehow check if it needs to be resent.

Thanks for any Advice..

Red.
Link to comment
https://forums.phpfreaks.com/topic/4259-php-ftp-dowload/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.