api ftp wince
Hello tcsa35,
I want to download a file via FTP. I tried two different ways:
1. Using the Internet* functions
At first I opened an internet session with InternetOpen. After that
I opened an URL with InternetOpenUrl to which I passed the fully
qualified URL (e.g.
ftp://myserver.com/dir1/dir2/dir3/myfile.dat).
Then I read the data with the function InternetReadFile and wrote it
to a file.
This basically works. But InternetReadFile always returns true, even
if the remote file doesn't exists; in this case the received data is HTML
code that describes the error (Yes, I'm aware of the fact that the
Internet Explorer is being used for this).
The API reference unfortunately states that the Ftp* functions are
only available on the x86 platform (hu, what about the promissed
platform independence of Windows CE?!).
2. I found a FTP class on PocketPC Developer Network
(**broken link removed**) that implements
the FTP by itself. This approach also works and it returns error codes
on failure.
Now my questions are:
* Is there another approach for doing this?
* Which approach would you recommend?
Anyway, if possible, I would like to use functions that are available
on a device by default or part of the Windows CE API.