Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.6k views
in .NET FTP by (200 points)
Hi,

We write our software using vb.net 2008 and are trying to transfer .accdb files or .zip files to an FTP site from one location and then download them from another. This is to copy data between retail store branches. Host machines vary between SBS Server 2003, 2011 Essentials and server 2011 Standard.

Copying .xml and .txt files that are small packets works fine between these sites.

I have found code on the net to use both FtpWebRequest and WebClient which we have tried and for some reason the files get corrupted during the transfer process. This is not every time and can get serval sucessful transfers between corruptions.

So we thought it would be a good idea to use an already developed .dll to do the tranfers. Hence we are now using your ftp dll to transfer the files but again are getting the same results where some transfer ok and others corrupt. One example is a file that on the main site location is 576KB but once FTP is done to the site and downloaded onto the other site is only 384KB and comes up as a corrupt access database.

Have you ever had this issue and if so do you know a way of resolving it?

I look forward to your reply.

Russell.

3 Answers

0 votes
by (200 points)
Dim ftp As New FTPConnection
ftp.ServerAddress = "ftp.site.co.uk"
ftp.ServerDirectory = FolderToUse
ftp.UserName = FTP_Username
ftp.Password = FTP_Password
ftp.Connect()
ftp.TransferType = FTPTransferType.BINARY

'upload a file
ftp.UploadFile(FilePath & FileName, FileName)

'close the connection
ftp.Close()
0 votes
by (200 points)
Hi,

I've found the issue now i think! Been a few days looking into this and thankfully with your control we have the option of logging which i enabled. This pointed me to the fact that we were downloading the files while they were still being uploaded!

This is why the file sizes always seemed different when it went wrong.

I've changed our code to upload the files with a temp file extension and once uploaded rename the files back and i've done a few tests and it now seems to be working ok!

Regards,

Russell.
0 votes
by (162k points)
Ok, that's often the case, and you've found the correct strategy for dealing with the problem.

Categories

...