Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.2k views
in .NET FTP by
Hello

I am trying to upload a 2MB zip file onto my webspace using an FTP Connection as demonstrated below. I have successfully transferred a couple of small text files but when I try and transfer the 2MB file it hangs when the transfer reachs 10,000 bytes. Why is this and how can I fix it?

Thanks
Paul


EnterpriseDT.Net.Ftp.FTPConnection ftp = new EnterpriseDT.Net.Ftp.FTPConnection();
try
{
ftp.UserName = "******";
ftp.Password = "******";
ftp.ServerAddress = @"ftp.*******.co.uk";

ftp.TransferNotifyInterval = 5;
ftp.TransferType = EnterpriseDT.Net.Ftp.FTPTransferType.BINARY;
ftp.Timeout = int.MaxValue;
ftp.BytesTransferred += new EnterpriseDT.Net.Ftp.BytesTransferredHandler(ftp_BytesTransferred);

ftp.Connect();

ftp.UploadFile(source, @"Backup/test9.zip"); // source, destination);
}
finally
{
ftp.Close();
}

1 Answer

0 votes
by (51.6k points)
Does it work when you remove the BytesTransferred event-handler? Also, the TransferNotifyInterval is in bytes, not kilobytes, so 5 is very low. I suggest you use something like 5000 instead.

- Hans (EDT)

Categories

...