Status
Not open for further replies.

skinner

Active Member
741
2010
59
5,200
Hi, I'm using that comand to upload to ftp with php:

PHP:
ftp_put($connect, $destination_file, $source_file, FTP_BINARY)

but how can I reup that file, for example max 5 times, if upload failed?

Thanks
 
2 comments
PHP:
$i = 1
for ($i = 1; $i<6;i++)
{
  if (!(ftp_put($connect, $destination_file, $source_file, FTP_BINARY)))
  {
    $i++;
      if ($i >= 5)
      {
        break;
      }
  }else{
     break;
  }
}
 
Last edited:
Status
Not open for further replies.
Back
Top