View Single Post
Old 04-21-2006, 04:10 AM   #3 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 733
DJMaze is on a distinguished road
serverside ftp:
http://dragonflycms.org/cvs/html/inc..._ftp.php?v=9.2

serverside http:
http://dragonflycms.org/cvs/html/inc...fake.php?v=9.2

my cpg_ftp class creates an connection thru FTP to overcome write permission issues on Windows servers and badly configured POSIX servers.
the cpg_ftpfake class has the same methods as cpg_ftp but works on properly configured servers.

I've created both classes so that there's an easy interface for upload management.

Code:
if ($use_ftp) {
    $ftp = new cpg_ftp('ftp://ftp.mydomain.com', 'myname', 'password', '/public_html/uploads/');
} else {
    $ftp = new cpg_ftpfake('', '', '', '/public_html/uploads/');
}

$ftp->up($source, $dest_file, $mimetype);
DJMaze is offline   Reply With Quote