Home » Community » Newbie corner » Ftp (Hi, I need to ftp an sqlite database up to and down from a website. Could you please provide an appropriate example)
Re: Ftp [message #48598 is a reply to message #47388] |
Fri, 04 August 2017 17:46   |
pfsdanny
Messages: 26 Registered: December 2011 Location: Hong Kong
|
Promising Member |
|
|
Hi,
As my knowledge sqlite is a single file base database engine. To upload the file to web server, you need to close all connection to the database. Then uses the plugin/ftp package to push your file to web server.
In IDE, select Project->Package organizer, Add plugin/ftp package to your package.
String data;
// read in your sqlite file to data
FtpClient ftp;
if (!ftp.connect(<webserverhostname/webserverip>, <ftpusername>, <ftppassword>, true, 10)) {
Exclamation("Connect error!");
return;
}
if (!ftp.Save(<thedestinationpath>, data) {
Exclamation("Save error!");
return;
}
ftp.Close();
|
|
|
Goto Forum:
Current Time: Tue Apr 29 14:03:37 CEST 2025
Total time taken to generate the page: 0.00761 seconds
|