MrBelfry
IS-IT--Management
- May 21, 2003
- 289
Hi there
I'm trying to upload a file to a remote server using PHP's FTP functions. Here is my code:
Unfortunately the file is not uploading properly. The filename appears on my server but it's file size is 0. I also get the following message
Please help! I've tried setting the time out to 0 and I've tried setting the upload mode to FTP_ASCII but it didn't seem to make any difference. I'm using Win2k, Apache and PHP 4.3.1 on my local machine and a LAMP configuration on the remote.
Thanks
MrBelfry
I'm trying to upload a file to a remote server using PHP's FTP functions. Here is my code:
Code:
$conn = ftp_connect($ftpserver);
$login = ftp_login($conn, $username,$password);
// upload the file
$destination = "/[URL unfurl="true"]www/images/events/$filename";[/URL]
$source = getcwd() . '\\flyerpics\\' . $filename;
$upload = ftp_put($conn, $destination, $source, FTP_BINARY);
ftp_close($conn);
Code:
Warning: ftp_put() [function.ftp-put]: PORT command successful
Thanks
MrBelfry