Put

Navigation:  Development > Function Reference > Module > Ftp >

Put

Previous pageReturn to chapter overviewNext page

Upload a file in remote server.

 

App::Module('Ftp')->put(Local File,Remote File);
 

Return downloaded file size.
 

Parameter

Type

Description

Local File

Mandatory

Local file name to download

Remote File

Mandatory

Remote file name to download

 

return true if success

 

See bellow examples:

 
$Ftp->Connect('ftp.example.com');
$Ftp->Login('username','********');
 
// Download file 
$size = $Ftp->Put(
    app::Config()->baseDir("/uploads/Winter.jpg"),
    'Winter.jpg'
);
 
// Also work like 
$size = $Ftp->Put(
    app::Config()->baseDir("/uploads/Winter.jpg"),
    'MyPic.jpg'
);