Download file invalid size

Apr 22, 2014 at 6:06 PM
Hi all,
I have issue with download file from FTP server. Some time size of files i downloaded bigger that original file size.

File extension on FTP Server is .XML and i try to open file with XML editor, it show error message "...Extra content at the end of the document". When i open file by notepad, i seem that have double character ">" in end of the XML tag.

I don't know why, can you help me solve the problem ?

Example :
Original file on FTP:
<IDoc>
<Header>
<IDocNo>0000000000469172201404221058049-B</IDocNo>
<Count>0</Count>
</Header>
</IDoc>

After download :
<IDoc>
<Header>
<IDocNo>0000000000469172201404221058049-B</IDocNo>
<Count>0</Count>
</Header>
</IDoc>>

Thanks
Coordinator
Apr 22, 2014 at 8:54 PM
Can't offer any suggestions without seeing code. But for what it's worth the stream objects are either a NetworkStream or SslStream over a socket so there is no additional processing of data by System.Net.FtpClient that's going or coming from the wire. If you're ending up with corrupted data it's because you're either doing something wrong or it's being corrupted in transit.
Aug 25, 2014 at 3:48 AM
Edited Aug 25, 2014 at 3:51 AM
Hi,
Sorry relay late. I try to download XML file and try to open with IE, Chrome, XML Editor, it raise message :
I used standard download function of FTP Client libs:

objFTpClient.Download(strPath & "/" & obj.Name, "\filename.xml")

"error on line 2 at column 230: Extra content at the end of the document"

Original XML file :

<ns0:MT_Promotion xmlns:ns0="http://company.com/PDW/ArticleMaster">
<IDoc>
<Header>
<IDOCType>OUTBOUND_PROMOTION</IDOCType>
<OutDate>13/08/2014 23:06:31</OutDate>
<SITECode>SG01</SITECode>
<IDocNo>0000000000436327201408131112025-B</IDocNo>
<Count>0</Count>
</Header>
</IDoc>
</ns0:MT_Promotion>

After download :

<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_Promotion xmlns:ns0="http://NK.com/PDW/ArticleMaster"><IDoc><Header><IDOCType>OUTBOUND_PROMOTION</IDOCType><OutDate>20/08/2014 23:04:02</OutDate><SITECode>SG01</SITECode><IDocNo>0000000000692126201408201109043-B</IDocNo><Count>0</Count></Header></IDoc></ns0:MT_Promotion>>