Jump to content

Using ftp_put to upload a file from linux server to windows server


t_miller_3

Recommended Posts

Here's the code:

 

<?php
$connection = ftp_connect('89.xxx.xx.xxx') or die("Couldn't connect to server");

ftp_login($connection, 'myusername', 'mypassword') or die("Couldn't login");

ftp_put($connection, "/folder/file.ini", "file.ini", FTP_BINARY) or die("Couldn't transfer file");

ftp_close($connection);
?>

 

I've tested the script and it works fine when uploading the file from one linux webserver to another however when I try to upload the file from a linux server to a windows server, I get this error message:

 

Warning: ftp_put() [function.ftp-put]: Port ok. in /home/timm/public_html/formtest/ftptest2.php on line 6

 

Can anyone help me with this?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.