What is LFtp ?

LFtp is a client ftp program for Palm Computing Platforms, that means not only true palms but also TRGPro and CLIe ( read further...) LFtp is based on NetSample, which is furnished in the Palm SDK, I removed a lot of useless (for me) features and added a lot of nice ones.

LFtp is mainly a command line interpreter which can launch only one utility: ftp. Beeing in ftp mode, one can upload and download palm databases (.pdb and .prc) to a ftp server.

Then I added some features:
- usefull simple commands: del, mkd, rmd
- add always .prc to the name of databases, so they can be dowloaded with ProxiWeb
- publish doc files as html: pub
- send and receive files directly from/to TRGPro compact flash: putcf, getcf
- send and receive files directly from/to CLIe memory stick: putms, getms
- automatic login sequence and scripted commands
- publish memos files as html: pubm - name files as they should be, with .prc or .pdb, now you can use LGet to download
- dir files from palm memory: ldir
- dir files from vfs (sd, mmc, cf, ms): ldirfs
- receive files directly to vfs (sd, mmc, cf, ms): getfs
- get text files (.html, .php, .asp, ...) as uncompressed doc files: getdoc
- store scripted commands in a memo: execmemo
- download text files into a memo: getmemo

Disclaimer

LFtp is free. There is no licence or something else. Just use it if you need. Satisfaction e-mails are greatly appreciated ! LFtp is furnished "as is". Without any warranty or support. I am not responsible of anything what can happen. It has been tested on several devices and works quickly but is not perfect, there are some known issues, but nothing more than a good old reset has been reported so far.

LFtp is a tool, not an application. What's the difference ? An application works well in all circumstances, a tool just do the job. LFtp is a tool for uploading and downloading files "on the road", and this works, don'texpect anything else. For example, if you try to download something with the 'get' command, LFtp will first delete an existing database on your palm, without warning, in other words, no seat belts

How to use LFtp ?

Once started, LFtp open a connection (if not already) and you will see this:

You are here in command line mode, you can use it as your favorite ftp utility. Just a few comments on available commands:

help: display help

pwd: print current directory on server

cd: change current directory on server

mkd: make a directory on server

reconnect: close and reopen NetLib, then reconnect to the ftp server

rmd: remove a directory on server del: delete a file on server dir: list content of current directory

ldir : ''list local directory (i.e. palm database names from ram only), if is set, prefix the listing with , (ok, the only usefull usage is: ldir put) ldir can be also used before beeing connected to the server"

put : upload file to ftp server, always add .prc to the name of file, works only with palm format databases, case sensitive (put LFtp will store LFtp.prc on server) get : download file from server, works only with palm format databases, case sensitive (get myprog.prc will store myprog on palm)

pub : publish uncompressed doc files only as text files (pub myfile.htm will store the contents of myfile.htm on server, assuming that the file name is myfile.htm in your favorite editor pubm : publish memos as text files, use title as file name getdoc : download text file from server and create an uncompressed doc file, case sensitive (get myprog.prc will store myprog on palm) execmemo : execute all commands stored in the memo, no more limitedby the text size in the preferences to store hundreds of commands, if one memo is not enougth chain a other one getmemo : download text file from server and create a memo, case sensitive (get mymemo.txt will create mymemo.txt, existing mymemo.txt will be destroyed)

TRGPro only putcf : upload file to ftp server from TRGPro compact flash, works with any file, path always starts from cf root, always store on current dir on server (putcf 001.jpg will store 001.jpg on server) getcf : download file from server and write it on TRFPro compact flash, works with any file, always get file from current dir on server, always store file on cf root (getcf 001.jpg will store 001.jpg on cf)

CLIe only putms : upload file to ftp server from CLIe memory stick, works with any file, path always starts from ms root, always store on current dir on server, must specify exact full path (putms /DCIM/100MSDCF/DSC00001.JPG will store DSC00001.JPG on server)

All devices with vfs (SD, MMC, CF, MS) ldirfs : list files on external file system putfs : upload file to ftp server from external support, works with any file, path always starts from root, always store on current dir on server, must specify exact full path (putfs /DCIM/100MSDCF/DSC00001.JPG will store DSC00001.JPG on server, use ldirfs to get exact syntax)
NOTE: for cf and ms path separator can be either / or \

That's all ? not ! It becames quickly a bit tedious even helped with shortcuts, so look at the menus, and open the preferences form with Menu/Misc/Preferences or shortcut command 0, you'll see this:

If "use prefs" is checked then automated login will be used. If "use prefs" and "use scripted commands" are checked then all commands stored will be executed after automated login.

One can start the full process by using shortcut command 1.

During transfer, LFtp displays dots, for get & put, each dot is a record or a ressource, for getcf & putcf, each dot is 4K.

Known issues features

- There is very limited support of TRGPro cf, no detection of changing the cf, it seems that AutoCF has to be disengaged (I don't have a TRGPro myself to make full support, sponsors are welcome )
- There is very limited support of vfs, no detection of changing thesupport, [I don't have a CLIe, H330 or m50x myself to make full support, sponsors are welcome ]
- Menus and clipboard operations doesn't works once in ftp mode, may gives "fatal error" , fixed in 1.3
- clipboard paste doesn't work once in ftp mode... well, it works but has no effects due to character handling used to simulate command line operations, fixed in 1.4
- recursive ftp is not safe (opening a new session while already in session works, but sockets ressources are very limited on Palm), better to 'quit' before...
- "dir" command may hangs sometimes, simply wait for the 30s timeout... or reset the device, or ask the ftp guy to disconnect your connection...
- LFtp crashes if trying to upload an empty (0 records) database fixed in 1.7.2
- trying to upload an inexistent database with LFtp will create an empty file on server, but you can use the del command
- removed clie/memory stick support, because the clie emulator doesn't reflect exactly a true clie with ms, and I'm tired of signing licences and ndas to obtain roms clie support standard vfs now
- the getfs command doesn't work, that's the problem with freewares, very low priority, now, it works !
- When trying to upload 16 files (or more) there was an error "too many connections (0x124F)" this is actually a "feature" of PalmOS, and the only way to perfectly clean the opened sockets is to close the NetLib. The new command "reconnect" does this in 1.8.6.

V 1.8.8c 18/11/2004
- in automatic mode (LFtpPro only), do not automatically close the line when exiting from LFtpPro
if you need to close the line, add a command line "close force" in the script this feature was created for Symbol devices with built-in GSM cards but causes troubles with Treo 600 which are always connected
- documented an hidden feature of the "close" command
uses "close force" to force the connection to close, usually it's a good thing to keep the connection open for other programms on a Palm device, so it should be used only on special circumstances

How to...

- to open a server with a non standard ftp port, just add the port number after a space (ex: ftp 1.2.3.4 888)
- using with POSE with the ftp server on the same machine: only 127.0.0.1 can be used if the host get his tcp/ip address from DHCP and is not connected to the lan (laptop with windows)
- using with MochaPPP, it can only works if the host has a valid tcp/ip address or host name can be resolved by DNS, don't expect to reach the host using 127.0.0.1
- spaces in file name ? try: put "file with spaces"
- upload multiple files with joker ? no, it's not safe, use "ldir put" to obtain a list of uploadables databases, remove unwanted ones, copy to scripted commands in preferences, etc...
- the combination of getmemo and execmemo allow to do very usefull things, like preparing on the server the list of files to download the next time for example:

execmemo mymemo.txt
getmemo mymemo.txt

will execute all commands stored in the memo, then download a new version of the memo, don't forget to put a quit command at the end of the memo Don't try to do something like 'execmemo mymemo.txt' with a 'getmemo mymemo.txt' inside, it will crashes, believe me, I'm the guy who wrote it.

It doesn't work...

It's possible ! Nothing is perfect. Remember that you have not payed anything

Check first if you are connected to the internet

If you can't open the ftp server at address 127.0.0.1, it's not a failure, I doubt you have an ftp server on your palm... (in fact you may have an ftp server on your palm, but due to the lack of threads it can't be launched with LFtp)

Strange messages about socket connection error ? try to check 'no PASV'

there is an unsollicited unhandled message between your ftp server and LFtp which is not understand, in other words, it's a bug...

It works with POSE, check 'redirect NetLib calls to host TCP/IP', in this case 127.0.0.1 works if there is an ftp server on the pc (maybe also on the mac, I don't know)

Download and history

go to the download area for the last version

LFtp 1.8.9: fixed 'dir' hanging with some ftp servers
V 1.8.8c 18/11/2004 - documented an hidden feature of the "close" command uses "close force" to force the connection to close, usually it's a good thing to keep the connection open for other programms on a Palm device, so it should be used only on special circumstances

V 1.8.8b 06/01/2004 - bug fix in getfs: the NO PASV prefs was not handled
LFtp 1.8.8: new command "getaf" allow to download AppForge database without the "two bytes gap" bug
LFtp 1.8.6: new command "reconnect"
LFtp 1.8.5: use TYPE A instead of TYPE I for pub & pubm, new parameter in put: put filename newfilename
LFtp 1.8.4: fixed getfs, verbose messages, an a few other things in the pro version
LFtp 1.7.6: fixed problems with Serv-U and some other verbose ftp servers
LFtp 1.7.5: bug fixes (now it seems to work with the PalmOS 5.0 Simulator), added getmemo
LFtp 1.7.4: bug fix (memory leak detected with last POSE)
LFtp 1.7.3: bug fix (force quit ftp when launching preferences)
LFtp 1.7.2: execmemo, bug fix with empty databases, memory failure in preferences
LFtp 1.7.1: getdoc, ldirfs, getfs, builded with sdk 4.0
LFtp 1.7 beta 4: partial support of external cards ldirfs, putfs (not yet getfs), bug fix with pose 3.3
LFtp 1.6.1: bug fix, no more crash when entering a backspace at the beginning of the command line
LFtp 1.6: choice of transfert mode PASV or not
LFtp 1.52: restored the naming conventions, .prc and .pdb
LFtp 1.51: added ldirm, pubm, removed putms
LFtp 1.5 beta: added putms, fixed a bug with passive mode on a few ftp server, for cf and ms path separator can be either / or \
LFtp 1.41: added ldir command
LFtp 1.4 beta : clipboard paste fixed, use passive mode (so can be used with MochaPPP)
LFtp 1.3 : multiple preferences (Warning: this will reset current preferences), shorcuts for multiples servers
LFtp 1.2 (automated login and scripted commands)
LFtp 1.01, 1.02, 1.03 ... (added putcf & getcf)
LFtp 1.0

Need some special feature ? like automated transfer, custom datas transformations, support of built-in gsm in Symbol spt17xx ? contact me (not freeware) and I'll talk you about LFtpPro, which includes all functions of LFtp plus two very usefull things:
- there is a a checkbox 'auto' in the preferences, when this is checked, LFtpPro start to execute the script as soon as it is launched - there is a new command 'launch' which allow to launch any application when the script is ended

The sources...

Here, you'll find the sources for LFtp. LFtp beeing based on NetSample from the Palm SDK, there may be some restrictions about it, ask your favorite lawyer...

LFtp is freeware, it's not gpl or open source or anything else like that. It's free. But if you use the sources, please respect these rules:
- drop me an email
- let it free and when you'll think it's stable, release the sources
- if you use it in a book, magazine, cd or anything else like that, send me a physical copy, please

Now, a few words about the project. You need CodeWarrior and the libraries and includes from the SDK 3.1, in this version it can't be build with the SDK 3.5 (maybe the reason why Palm has removed it from NetSample) TRGPro support use an hacked version of ffslib.h (sorry) there was a conflict with the includes... Sony CLIE support is also tricky (sorry) as the virtual file system need os 3.5, dirty, but it works...

Download LFtp 1.5b3 sources

v 1.51 1/04/2000 added 2 new commands: ldirm list all memos pubm upload a memo (title is used as file name) removed all the memory stick support (Clie) (not really removed, just within comments) because the clie emulator doesn't reflect exactly a true clie with ms, and I'm tired of signing licences and ndas to obtain roms

Download LFtp 1.51 sources

Download LFtp 1.52 sources

v 1.6 26/07/2001 may be used in non passive mode for some people experimenting troubles with the PASV default mode

Download LFtp 1.6 sources

v 1.6.1 03/08/2001 bug fix Download LFtp 1.6.1 sources

Where are the sources of 1.7x and above? only on my pc, and yes, it works with CW8 or CW9 and sdk 4.0 ...

Previous comments

Gavin Peacock writes on mercredi 12 mars 2003 @ 10:37 MET: Hi, You've done great work on LFTP. Ron and I worked on the orginal netlib stack at Palm. I wrote netnews and ron wrote the netsample stuff. One thing you really should do is use Exchange Manager. This will allow you to recieve any kind of native data format. When you receive an FTP file, just send it to exchange manager instead of writing it out as a database. YOu can then get rid of the ugly database internal stuff. Exchange Manager will send prcs and pdbs to launcher and let it load them. Text files will go to memopad automatically, vcard and vcalendar files will go to the addressbook and datebook. All third party developers are supporting this, so you can also deal with things like jpeg, mpeg, mp3, mid, work and excel files and more! The simplest thing to do is just use ExgPut to the local exchange library. If you want to get fancier, you could write an FTP exchange library and any application could use the Send Menu to send to FTP! There are also ways to ask applications to send data. If you want more information or sample code, just ask!

loic writes on mercredi 28 mai 2003 @ 05:36 MEST: comment fait on pour avoir les sources qui compilent avec CW8ou9

laurent@thalers.org writes on mercredi 28 mai 2003 @ 05:54 MEST: les sources pour CW8 ou 9 ? ouh là là, faut que je vérifie le cours du jour mais çà fait dans les 2 Tungsten C et 3 Zire 71 !

Tony Crespo writes on vendredi 30 mai 2003 @ 04:42 MEST: Dear people, from Caracas-Venezuela we would like to know is your FTP-Palm product has a capability to use a conection via Palm RAS Client. Palm only support one program running and if we run a Palm RAS conection and after try to run LFtp, the RAS conection is dropped. How we can use a Hotsync conection to transfer files with LFtp? Does LFtp only work with tcpip online conection? If the answer is negative, do you can add this features, and which will be the cost? Best Regards,

Arijit Das writes on vendredi 01 août 2003 @ 10:30 MEST: I want to write a C program for the PALMOS to send a file over HTTP (HTTP POST). Do you have any pointers or have any sample code? If not HTTP is there any sample code for a scoket to socket connection to send data (file chunks) ?

laurent@thalers.org writes on samedi 02 août 2003 @ 10:35 MEST: have a look at the archives at http://www.escribe.com/computing/pcpqa/index.html and http://www.palmopensource.com

Iain Harrison writes on mercredi 06 août 2003 @ 04:51 MEST: I want to ftp a file to a ditrectory with an underscore in its name. I don't know how to type a _ character on my Treao180, but I can copy one to the pasteboard - but I can't paste into the ftp program. Is there another way to do it?

laurent@thalers.org writes on mercredi 13 août 2003 @ 10:41 MEST:
1) I'm sure there is a way to do an underscore with the treo180, check the graffiti help
2) you're best choice is to store your commands in a memo, then use 'execmemo'

gulnaz writes on jeudi 07 août 2003 @ 09:15 MEST: Hi, I downloaded the source code for LFTP. It was really excellent to use the application for transfer of pdb files. I m new to palm programming. I need to write an application which transfers .xml or .csv files stored on palm os to desktop pc and vice versa. Can you please tell me whether these file formats are supported by palm OS or i need to create a pdb file only. Please Help....trying hard to find information on net Thanks and Regards, Gulnaz '' laurent@thalers.org writes on mercredi 13 août 2003 @ 10:54 MEST:'' there is no native support of .xml or .csv files in PalmOS if you have already have an application which can handle this kind of files on your palm devices you have two choices:
1) you have a desktop conduit which translate xml or csv files to native palm .pdb files, in this case LFtp is able to upload or download these .pdb files, that's all, LFtp is a file mover
2) your programm is able to read .xml or .csv files for the external (vfs) support which is FAT based, in this case, LFtp is able to transfer files from the vfs support with 'getfs' and 'putfs'

Marlon writes on jeudi 14 août 2003 @ 06:41 MEST: Would like to have information about the lftpPro and also about how to obtain the sources for the latest version 1.8.6. TIA. Marlon marlon@morse.com.br

LTH writes on jeudi 14 août 2003 @ 04:07 MEST: a demo version of LFtpPro is available upon request, send me an email, LFtpPro is not freeware, the price is near to the price of the most expensive device from palm.com in europe http://www.palm.com/fr/store/palmdirect.html today it's Palm™ Tungsten™ C Handheld 565 EUR add a zero to the right of the last price and I'll send you the source code

Alexandre writes on mercredi 10 septembre 2003 @ 02:06 MEST: Hi, I'm having probelms whan transfering many files after send some like 12 .. 13.. i get conection erros.. i cant get the data socket conect.. it gives me mem socket error something like that.. and no more trnasfers are done... any clue? i'm using 1.6.1 thnx

laurent@thalers.org writes on jeudi 11 septembre 2003 @ 12:44 MEST: this is fixed in 1.8.6

Alexandre writes on jeudi 11 septembre 2003 @ 01:28 MEST: But it's not taht error sometimes it hapens with the 7 file e try to download when i'm geting a file sometimes i get the error bad database type..something like that and after that i just get socket read error. timeout (0x1212) and nothing more is recived other time i get conection refused and no daata conection is made thnx

Maik Ryuge writes on jeudi 11 septembre 2003 @ 03:21 MEST: Hi! About Lftp 1.61 sourcer. It's complete ? What version CodeWarrior I must be using ? I don't find a SysAll.H ? Could you help me ? Thank's Maik Ryuge

laurent@thalers.org writes on jeudi 11 septembre 2003 @ 08:42 MEST: yes, the sources for LFtp 1.61 are ok (but completely outdated...) you need Code Warrior 6 and the SDK 3.0 or 3.1

Maik Ryuge writes on samedi 20 septembre 2003 @ 12:07 MEST: Hi! I dont found CodeWarrior 6. It´s is very dificult. So, Do you have sourcer compatible with CodeWarrior 8 or CodeWarrior 9 ? I liked trasnlate this in portuguese. After,I send you one copy sourcer translated. What do you think ?

Maik Ryuge laurent@thalers.org writes on samedi 20 septembre 2003 @ 06:16 MEST: The sources of the lasts versions of LFtp are not in public domain.

Roger writes on mercredi 15 octobre 2003 @ 09:32 MEST: I'd like to send/receive images (jpeg/jpg) with LFtp. Is this possible? I only found to send/receive prc/pdb and to publish html. It would be sufficient to have an option to switch off the adding of prc/pdb. Roger

LTH writes on mercredi 15 octobre 2003 @ 04:02 MEST: Yes, LFtp can upload everything use putfs and getfs to upload and download any file from the extension card

Marcos writes on mercredi 03 décembre 2003 @ 07:01 MET: Muito Obrigado

Sivuca writes on samedi 13 décembre 2003 @ 01:34 MET: How about calling LFtp from another aplication. some like "LFtp server1" to automatize itegration with other programs.

laurent@thalers.org writes on samedi 13 décembre 2003 @ 11:50 MET: Something like this ?

LocalID localID; 
localID=DmFindDatabase (0, "LFtpPro"); 
if (localID) SysUIAppSwitch(0, localID, sysAppLaunchCmdNormalLaunch, "LFtpProParam");

Maik Ryuge writes on mardi 16 décembre 2003 @ 11:32 MET: Hi! I have problem, when I´m make download in greater pdb file. It´s possible received file with 1000 regs our more ? How can I do ? Thanks

laurent@thalers.org writes on mercredi 17 décembre 2003 @ 09:13 MET: Download speed to internal memory is record number dependant, it's quicker to download a small number of big records than a big number of small records. It's a feature of HotSync, by design...