Ftp Server on Arduino

A new version is available
See message #144

I begun to work to a FTP server on Arduino
The reason is that I have made a mp3 player (see La Rocola – Mes projets pour mieux profiter de mon hamac or Écouter la radio en streaming - Réalisations et Projets Finis - Arduino Forum ) and don't want to remove the SD card each time I need to update his content.
The hardware consist of an Arduino Due and an Ethernet shield or a WIZ820io.
I guess it cant work on an Mega2560 reducing comments or using F() macro.
The software is on GitHub at GitHub - gallegojm/Arduino-Ftp-Server: Ftp server for Arduino Due and Ethernet Shield or WIZ820io
This is a first release: incomplete and may be buggy?
Not all ftp commands are implemented but enough to parse directories and download files.
User is 'arduino' and password is blank
It only accepts clients in active mode
I probe it with the following clients software:

  • FTP Rush : looks like it is working without problem
  • FileZila : parsing directories is ok. But when trying to download a file, FileZila first reconnect, without deconnecting before. I don't no how to handle that. A trick is to send manually the command QUIT.

I use those external libraries:

I use internal library Ethernet
For using Wiz820io it is necessary to make some changes (see DUE ethernet performance on W5200 with SPI and SPI+DMA - Arduino Due - Arduino Forum and GitHub - jbkim/W5200-Arduino-Ethernet-library )
It is also necessary to add two functions. See my post there: More functions needed in Ethernet library - Libraries - Arduino Forum

I would appreciate remarks, sugestions, testing, ...

I reorganize the entire code so it is now written as a class.
So it is easier to integrate the FTP server in a more complex project.
Just a call to FtpServer::init() in the setup() function of your sketch and an other call to FtpServer::service() in the loop() function to run the FTP server in the background.
Function FtpServer::service() is non blocking even during file transfers.
I add a few commands:
PASS By default the password is Due. You can change it (as the user) in file FtpServer.h
ABOR
SIZE
STOR Only works with 8.3 named files
and correct some bugs.
It is now necessary to add only one function to the Ethernet library. Not two as I said in my previous post. See comment at beginning of file FtpServeur.ino
Please download at GitHub (GitHub - gallegojm/Arduino-Ftp-Server: Ftp server for Arduino Due and Ethernet Shield or WIZ820io) and give me your opinion and comments.

Until today I had the opportunity to see your post.

The content of your post is excellent.

I do not yet tests with your proposed.
Reading even with much interest.

At this time I have at hand,
example of code that I received from people of www.wiznet.co.kr.

FTP DAEMON (attach).
I understand it's code written in C
I do not know much, does not work with Arduino IDE.

I seek Now:
Something like your code, but without modification Ethernet.h
Something like this FTP DAEMON samplex C, but with code for arduino IDE.
Something working properly with TCP protocol.

I have no idea how to translate,
from C language for Arduino IDE code.

I appreciate any related information.

now I go to GitHub - gallegojm/Arduino-Ftp-Server: Ftp server for Arduino Due and Ethernet Shield or WIZ820io

ftpd.zip (52.9 KB)

It only accepts clients in active mode

This will be a real problem if the FTP client is behind a router. The FTP server will not be able to connect to the client to open the data channel. Passive mode is the only way it will work and be relatively universal. The client connects and opens both the command and data channels.

If you plan on using this on your localnet only, active is the simplest way for the Arduino server.

If you want to see FTP client code for the Arduino ethernet shield, here is mine.
http://playground.arduino.cc/Code/FTP

Hi SurferTim

This will be a real problem if the FTP client is behind a router.

Yes, I know that

If you plan on using this on your localnet only, active is the simplest way for the Arduino server.

That is the case, as you can understand reading my entire post.
If somebody need passive mode and can add this feature to the code, it would be nice.
Don't hesitate to fork my repository on GitHub

If you want to see FTP client code for the Arduino ethernet shield, here is mine.

By the way your code help me understand some features of ftp protocol. Thanks

Here is the last version of my FTP server:

It is much more complete than the previous version.
It now accept clients in both active or passive mode.
Here is the list of recognized commands:
** USER, PASS**
** CDUP, CWD, QUIT**
** MODE, STRU, TYPE**
** PASV, PORT**
** ABOR**
** DELE**
** LIST, MLSD, NLST**
** NOOP, PWD**
** RETR, STOR**
** MKD, RMD**
** RNTO, RNFR**
** FEAT, SIZE**
And an additional command SITE FREE that send the amount of free space in the SD card and his total capacity.
The library is divided into two classes. One handle the ftp server functions: FtpServer . The other handle the calls to the SdFat library: SdList.
For this version, I abandoned the use of long file names, and the class SdList can seem superfluous but it will facilitate in the future a change in handling of file names (I am working on that).
You must care of not delete or rename a file that has a long name because the SdFat library does not handle it and this would result in orphan directory entries.

The server always works fine with client FTP Rush.
I still do not know how to solve the problem of FileZila with RETR and STOR.
It works well also with gFTP under Ubuntu.
And a second Arduino can connect to Ftp Server running the sketch of SurferTim. You can download it at Arduino Playground - FTP

As always I would appreciate remarks, suggestions, testing

I joy to see your post.

I do not even testing the code,
But I have very clear your dedicated effort.

Let me clarify that: I appreciate your effort.

#include <Ethernet.h> NOT include the protocol TCP

Allow me to introduce the orbits of Mars according Ethernet.h

Here is the last version of the same:

Anyway, I guess that works.
Good or bad, but it's working.

To me, I would like it to work correctly.

Here only presented my thanks,
and some ideas
I'm not someone to obey my whims.

I express my sincere thanks,
I will use your code,
while not achieve: TCP with Arduino IDE.

(deleted)

I receive this message from Thierry and I think this discussion may be of interest to other people, so I transcribe his message:

Hi,

I recently had to implement a FTP server on a Arduino Mega board and I found yours very interesting !
It works fine after a tiny bug fix (timeout casting).

My problem now is that it is quite slow when storing data on my embedded SD card.
I made some debugging and found that the data.read call in FtpServer::doStore very often returns 0 meaning the Arduino board is waiting for the FTP client to send something. I tried with several FTP Client as Filezila running on a PC and it seems the consequence of this is that the maximum rate is abouty 10 KBits/s...

Did you face this kind of problem as well ?

Thanks for your help and, once again, thanks a lot for your hard work on the FTP protocol implementation !

Regards,
Thierry

First of all, I am happy to know that this application runs on an Arduino Mega.
Secondly, I would like more clarification on the 'tiny bug fix'. Is it specific to Mega?
There certainly has room for improvement in my code, or to correct errors.
About the transfer velocity, as you know, this is the slowest link which affects the final speed.
Here, I think the most penalizing links are ethernet controller, memory card and how it is connected to the microcontroller.
With a Wiznet Wiz820io and a generic micro SDHC card connected directly to the SPI bus of an Arduino Due (only possible with 3V3 micros, don't try this with your Mega!) I get write transfers above 130 Kbytes per second speeds on files of several mega size, using FTP Rush
I made my first test with an ethernet shield equipped with the W5100 controller and I remember that the bitrate was in the order you specify.
You can now find shields equipped controller W5200, without the necessity to adapt a Wiz820io yourself as I do
About Filezila: do you have the same problem as me, about the fact that FileZila seeks to reconnect before starting a transfer?
Thank you for your interest in my library

I made some debugging and found that the data.read call in FtpServer::doStore very often returns 0 meaning the Arduino board is waiting for the FTP client to send something

More precisely, the Arduino is waiting for the ethernet controller to receive data. The latter is the bottleneck, not the FTP client.

Hello everybody,

First of all, please excuse me for my poor English (I am French, so I have excuses !)

gallegojm is right, I should have posted this message to this forum instead.

Concerning the change I made :
FtpServer.cpp : line 101 : millisTimeOut = FTP_TIME_OUT * 60 * 1000 => millisTimeOut = (uint32_t)FTP_TIME_OUT * 60 * 1000;
I did that because the timeout systematically triggered because millisTimeOut was not casted to uint32.

In my project, I developped a software to receive captured pictures from a camera (trendnet TV-IP322P) connected on an ethernet link and to manage this camera's power supply in order to be able to use it with a battery (22 Ah). This camera has to be installed in a sewer to observe used water behaviour for my company.

I use an Arduino mega + Ethernet Shield with micro-SD card support. So, I needed to implement a small automatisation function to drive the camera's powersupply + a FTP server to upload/download the pictures from the camera's pictures + a Webserver to ease the Arduino board configuration.

In order to simplify the webserver interface, I developped a HTML file using Dreamweaver with tags (eg : #NBFILES#). I upload this file to the Ethernet shield SD card, then each time the program receives a GET message from the user, it reads ths HTML file from the SD card, replaces the tags with the corresponding information and send it to the HTTP client.

Everything works fine except the time needed by the camera to send the images to the FTP server. Around 7 secs for a 70KBytes image, which is 10 KBytes/s (and not 10 KBits/s as I mentioned...). This is quite long for me because every second lost will decrease the autonomy of the deployement which is related to the battery.
Not mentioning the fact that I currently need the camera to capture pictures but I will later need videos instead ...

After your comment, I will try to find another Ethernet shield with a W5200.

Anyway, I am very happy to have found this FTP server dev for Arduino ! Thanks a lot, gallegojm !

Thierry

Concerning the change I made :
FtpServer.cpp : line 101 : millisTimeOut = FTP_TIME_OUT * 60 * 1000 => millisTimeOut = (uint32_t)FTP_TIME_OUT * 60 * 1000;
I did that because the timeout systematically triggered because millisTimeOut was not casted to uint32.

Thank you Thierry for the correction.
It is not necessary with the 32 bit CPU of a Due but needed with the Mega.
Speaking of Due and Mega... I think that once you have replaced the ethernet controller with a W5200, throughput will be limited by the speed of the ATmega2560. Maybe you have to consider the use of an Arduino Due
By the way, your project looks great!

Well I I am newbie and would test with Mega2560r3

I see this message only:

error: 'SdFat' does not name a type

Not find any updated version.

I appreciate your time and attention

Remember you need to install SdFat and Streaming libraries in order to run this sketch
Have a look a this link if you don't know how to install libraries: http://arduino.cc/en/Guide/Libraries

Ok,

I found this site: Google Code Archive - Long-term storage for Google Code Project Hosting.
And this version that brought Santa Claus Dec 25: sdfatlib20131225.zip

And the other:

http://arduiniana.org/libraries/streaming/
The latest version: Streaming5.zip

I hope this is correct. I'll try with Mega2560.

The SdFat: Google Code Archive - Long-term storage for Google Code Project Hosting.
And this version that brought Santa Claus Dec 25: sdfatlib20131225.zip

Installed and Checked, SD Info is very good and long names too.
With default: Arduino Ethernet shield, pin 4.

I Get this SDInfo:

SdFat version: 20131225

type any character to start

init time: 3 ms

Card type: SD2

Manufacturer ID: 0X2
OEM ID: TM
Product: SA01G
Version: 0.3
Serial number: 151072924
Manufacturing date: 3/2010

cardSize: 987.76 MB (MB = 1,000,000 bytes)
flashEraseSize: 128 blocks
eraseSingleBlock: true

SD Partition Table
part,boot,type,start,length
1,0X0,0X6,39,1927232
2,0X0,0X0,0,0
3,0X0,0X0,0,0
4,0X0,0X0,0,0

Volume is FAT16
blocksPerCluster: 32
clusterCount: 60210
freeClusters: 17420
freeSpace: 285.41 MB (MB = 1,000,000 bytes)
fatStartBlock: 40
fatCount: 2
blocksPerFat: 236
rootDirStart: 512
dataStartBlock: 544
Data area is not aligned on flash erase boundaries!
Download and use formatter from www.sdcard.org/consumer!

type any character to start

The Streaming from: Streaming | Arduiniana
The latest version: Streaming5.zip

Installed and Checked, I get from Serial port this:

This is an example of the new streaming
library.  This allows you to print variables
and strings without having to type line after
line of Serial.print() calls.  Examples: 
A is 65.
The current date is 17-4-2009.
You can use modifiers too, for example:
A is 41 in hex.

I do the adds In File EthernetServer.h add:

           EthernetClient connected();

and the other file EthernetServer.h add:

           EthernetClient EthernetServer::connected()
           {
             accept();
             for( int sock = 0; sock < MAX_SOCK_NUM; sock++ )
               if( EthernetClass::_server_port[sock] == _port )
               {
                 EthernetClient client(sock);
                 if( client.status() == SnSR::ESTABLISHED ||
                     client.status() == SnSR::CLOSE_WAIT )
                   return client;
               }
             return EthernetClient(MAX_SOCK_NUM);
           }

But only see this error compiling FTPServeur:

In file included from D:\Arduino\arduino-1.0.5\libraries\SdFat/SdStream.h:27,
                 from D:\Arduino\arduino-1.0.5\libraries\SdFat/SdFat.h:39,
                 from /FtpServer.h:31,
                 from FtpServer.cpp:20:
D:\Arduino\arduino-1.0.5\libraries\SdFat/iostream.h: In function 'ostream& endl(ostream&)':
D:\Arduino\arduino-1.0.5\libraries\SdFat/iostream.h:40: error: 'ostream& endl(ostream&)' redeclared as different kind of symbol
D:\Arduino\arduino-1.0.5\libraries\Streaming/Streaming.h:100: error: previous declaration of '_EndLineCode endl'

I appreciate your time and attention.

But only see this error compiling FTPServeur:

In file included from D:\Arduino\arduino-1.0.5\libraries\SdFat/SdStream.h:27,
from D:\Arduino\arduino-1.0.5\libraries\SdFat/SdFat.h:39,
from /FtpServer.h:31,
from FtpServer.cpp:20:
D:\Arduino\arduino-1.0.5\libraries\SdFat/iostream.h: In function 'ostream& endl(ostream&)':
D:\Arduino\arduino-1.0.5\libraries\SdFat/iostream.h:40: error: 'ostream& endl(ostream&)' redeclared as different kind of symbol
D:\Arduino\arduino-1.0.5\libraries\Streaming/Streaming.h:100: error: previous declaration of '_EndLineCode endl'

You right.
I forgot to mention that endl is defined twice: once in Streaming.h (line 100) and again in iostream.h of SdFat library.
So you have to eliminate one of this definition.
I comment lines 40 to 43 in iostream.h

/** insert endline
 * \param[in] os The Stream
 * \return The stream
 */
 /*             <==  ADD THIS LINE
inline ostream& endl(ostream& os) {
  os.put('\n');
#if ENDL_CALLS_FLUSH
  os.flush();
#endif  // ENDL_CALLS_FLUSH
  return os;
}
*/            <==  AND THIS

The error must disappear, keep me informed

thank you very much

Want to think optimistically we're making progress.

My Arduino IDE is 1.0.5 version Windows and try this with Mega2560

FtpServeur\FtpServer.cpp.o:(.bss.ftpServer+0x0): multiple definition of `ftpServer'
FtpServer.cpp.o:(.bss.ftpServer+0x0): first defined here
d:/arduino/arduino-1.0.5/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions
FtpServeur\FtpServer.cpp.o: In function `FtpServer::readChar()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:517: multiple definition of `FtpServer::readChar()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:517: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::closeTransfer()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:491: multiple definition of `FtpServer::closeTransfer()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:491: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::doStore()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:475: multiple definition of `FtpServer::doStore()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:475: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::doRetrieve()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:462: multiple definition of `FtpServer::doRetrieve()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:462: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::disconnectClient()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:116: multiple definition of `FtpServer::disconnectClient()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:116: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::userIdentity()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:122: multiple definition of `FtpServer::userIdentity()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:122: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::userPassword()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:139: multiple definition of `FtpServer::userPassword()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:139: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::clientConnected()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:108: multiple definition of `FtpServer::clientConnected()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:108: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::processCommand()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:155: multiple definition of `FtpServer::processCommand()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:155: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::service()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:42: multiple definition of `FtpServer::service()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:42: first defined here
FtpServeur\FtpServer.cpp.o: In function `FtpServer::init()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/FtpServer.cpp:25: multiple definition of `FtpServer::init()'
FtpServer.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/FtpServer.cpp:25: first defined here
FtpServeur\LongNames.cpp.o: In function `dirLfnNext(char*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/LongNames.cpp:49: multiple definition of `dirLfnNext(char*)'
LongNames.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/LongNames.cpp:49: first defined here
FtpServeur\LongNames.cpp.o: In function `dirLfnFirst(char*, char*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/LongNames.cpp:32: multiple definition of `dirLfnFirst(char*, char*)'
LongNames.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/LongNames.cpp:32: first defined here
FtpServeur\LongNames.cpp.o: In function `l2sName(char*, char*, char*, unsigned int)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/LongNames.cpp:136: multiple definition of `l2sName(char*, char*, char*, unsigned int)'
LongNames.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/LongNames.cpp:136: first defined here
FtpServeur\LongNames.cpp.o: In function `l2sPath(char*, char*, unsigned int)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/LongNames.cpp:161: multiple definition of `l2sPath(char*, char*, unsigned int)'
LongNames.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/LongNames.cpp:161: first defined here
FtpServeur\SdList.cpp.o: In function `SdList':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:7: multiple definition of `SdList::SdList()'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:7: first defined here
FtpServeur\SdList.cpp.o: In function `SdList':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:7: multiple definition of `SdList::SdList()'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:7: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::free()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:81: multiple definition of `SdList::free()'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:81: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::capacity()':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:76: multiple definition of `SdList::capacity()'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:76: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::openFile(SdFile*, char const*, unsigned char)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:66: multiple definition of `SdList::openFile(SdFile*, char const*, unsigned char)'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:66: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::nextFile(char*, bool*, unsigned long*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:48: multiple definition of `SdList::nextFile(char*, bool*, unsigned long*)'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:48: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::rename(char const*, char const*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:45: multiple definition of `SdList::rename(char const*, char const*)'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:45: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::chdir(char const*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:11: multiple definition of `SdList::chdir(char const*)'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:11: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::rmdir(char const*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:40: multiple definition of `SdList::rmdir(char const*)'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:40: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::mkdir(char const*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:32: multiple definition of `SdList::mkdir(char const*)'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:32: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::remove(char const*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:27: multiple definition of `SdList::remove(char const*)'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:27: first defined here
FtpServeur\SdList.cpp.o: In function `SdList::exists(char const*)':
D:\Arduino\arduino-1.0.5\libraries\FtpServeur/SdList.cpp:19: multiple definition of `SdList::exists(char const*)'
SdList.cpp.o:C:\DOCUME~1\RICARD~1\CONFIG~1\Temp\build593232682529899883.tmp/SdList.cpp:19: first defined here

My Arduino IDE is 1.0.5 version Windows and try this with Mega2560

I suggest you to download version 1.5.6-r2 of Arduino Software
They said it is beta but it is really stable.
I probe just now to compile FtpServeur.ino selecting Arduino Mega2560 with no problem
Remember to make the change suggested by Thierry:

FtpServer.cpp : line 101 : millisTimeOut = FTP_TIME_OUT * 60 * 1000 => millisTimeOut = (uint32_t)FTP_TIME_OUT * 60 * 1000;