I’ve implemented the HTTP and FTP server using the MDK4.03 and RL-ARM 4.05 in a system based on LPC2468. The system makes use of a flash file system implemented in an SPI flash memory. The HTTP implementation works fine I can download and upload files to/from the file system on the device. When I tried the FTP server using the Windows command line FTP client utility I can connect to the FTP server, I can get a directory of the file system but I cannot get the files from the embedded file system. What is very strange is that I use the “mget *” command and the utility asks me if I want to get “file1” and I answer ‘y’ but then it says “File Not Found” and the same happens for the other files that were previously stored via the web interface. If I try to use the "put" command the Windows command line FTP client utility accepts the command but does not do anything. I used another FTP client app, the one from Total Commander and with it I can “put” files into the device but I cannot get them back. Besides Total Commander adds a “\” at the beginning of the file name. In the “NetConfig.c” I setup 10 TCP sockets, 4 to serve 4 HTTP sessions and 6 for 3 FTP sessions (I read in the TCPnet docs that the FTP server uses 2 sockets per session). I checked with Wireshark what is happening, I see the commands being sent and the responses coming from the embedded device so the TCP side is working. I noticed that the FTP server uses port 21 for command and ports starting with 1025 for data.
What I do not understand is why do I get the “”File Not Found” on get when a “dir” shows the file is there. Where should I look to find the problem? The “FTP_uic.c” is included in the project, the FTP file system access functions are very similar to the ones from the “HTTP_uic.c” .
Any pointer towards solving this problem will be greatly appreciated.
Many thanks, Doru
Hi Friend,
I'm now in the same point that you...using UPLOAD and DOWNLOAD from HTTP is all right, so when i try use FTP...i have the "\" problem. Did you solve this in your application ?
Best Regards !
Fabio Boaretti
Hi Fabio,
I haven't solve that issue, I'm in the process of porting MDK_PRO 4.20 in this application. I will post the results when done.
Best regards, Doru
Hi Doru,
I believe that i solve the problem, i using 4.13 but i made some changes in the FTP_uif.c below the code changed for you test, in here now i able to do all operations over FTP runing in the RAM...take a look, was just the (fname+1)... below:
void *ftp_fopen (U8 *fname, U8 *mode) { /* Open file 'fname' for reading or writing. Return file handle. */ return (fopen ((const char *)fname+1, (const char *)mode)); } BOOL ftp_fdelete (U8 *fname) { /* Delete a file, return __TRUE on success. */ if (fdelete((char *)fname+1) == 0) { return (__TRUE); } return (__FALSE); } BOOL ftp_frename (U8 *fname, U8 *newn) { /* Rename a file, return __TRUE on success. */ if (frename((char *)fname+1, (char *)newn) == 0) { return (__TRUE); } return (__FALSE); }
Best Regards
Hi
could you give me example code for download file from http server. i can upload file to http server and with netCGI_ProcessData can handle input files data. But I don't know with which function in HTTP_Server_CGI.c could send data to browser.
thanks a lot