FTP upload not possible with ActiveSync 3.7.1?
From: Roberto Rocco (roberto.rocco_at_atoll.biz)
Date: 08/17/04
- Next message: Roberto Rocco: "How to programmatically shut down ActiveSync?"
- Previous message: Tim: "Re: Problems With ActiveSync and Contacts!"
- Next in thread: Chris De Herrera: "Re: FTP upload not possible with ActiveSync 3.7.1?"
- Reply: Chris De Herrera: "Re: FTP upload not possible with ActiveSync 3.7.1?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 17 Aug 2004 10:24:15 +0200
Hello,
uploading files to a FTP server always fails when I try to do it using an
active ActiveSync connection.
The very same code works perfectly instead when the FTP upload is done via
WLAN or a Modem.
The connection to the server is working properly, only the attempts to
upload files using FtpPutFile() fails when using ActiveSync.
The call to FtpPutFile() never returns, and all you can see on the FTP
server is that a file of the length 0 bytes is created.
What's wrong?? Why is FTP uload not working through ActiveSync?
I'm using ActiveSync Version 3.7.1 on a Windows XP machine and try to
connect using Pocket PC 2003 "T-Mobile MDA II" and several other Windows
CE.NET 4.2 devices.
All are showing the same behaviour.
Is that a known bug?
Below you can find a snippet of our code:
Many thanks in advance for every hint.
Best regards,
Roberto Rocco.
......
private void button1_Click(object sender, System.EventArgs e)
{
IntPtr hInternet = IntPtr.Zero;
IntPtr hConnection = IntPtr.Zero;
try
{
hInternet = InternetOpen(@"FTPClient",
INTERNET_OPEN_TYPE_DIRECT,
null,
null,
0);
if(hInternet == IntPtr.Zero)
{
MessageBox.Show ("Error in InternetOpen()!", "FTP Error",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button1);
return;
}
hConnection = InternetConnect(
hInternet,
"Hostname",
INTERNET_DEFAULT_FTP_PORT,
"Username",
"Password",
INTERNET_SERVICE_FTP,
0,
0);
if(hConnection == IntPtr.Zero)
{
MessageBox.Show ("Error in InternetConnect()!", "FTP Error",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button1);
return;
}
bool bRet = FtpPutFile (
hConnection, @"\Program Files\FtpTestWinInet\Test.txt",
"Test.txt",
FTP_TRANSFER_TYPE_BINARY,
0);
if(bRet == false)
{
MessageBox.Show ("Error in FtpPutFile()!", "FTP Error",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button1);
return;
}
MessageBox.Show("FTP Upload successful");
}
catch (Exception ex)
{
MessageBox.Show ("Unhandled error occured!", "FTP Error",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button1);
}
finally
{
if (hConnection != IntPtr.Zero)
{
bool ret = InternetCloseHandle(hConnection);
if(ret == false)
{
MessageBox.Show ("Closing the FTP connection failed", "FTP
Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button1);
}
}
if (hInternet != IntPtr.Zero)
{
bool ret = InternetCloseHandle(hInternet);
if(ret == false)
{
UInt32 ErrorNumber = (UInt32)Marshal.GetLastWin32Error();
MessageBox.Show ("Closing the Internet connection failed!",
"FTP Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
MessageBoxDefaultButton.Button1);
}
}
}
}
- Next message: Roberto Rocco: "How to programmatically shut down ActiveSync?"
- Previous message: Tim: "Re: Problems With ActiveSync and Contacts!"
- Next in thread: Chris De Herrera: "Re: FTP upload not possible with ActiveSync 3.7.1?"
- Reply: Chris De Herrera: "Re: FTP upload not possible with ActiveSync 3.7.1?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|