Problem transferring compressed files via System.Net.FtpWebRequest

  • Thread starter Thread starter SR
  • Start date Start date
S

SR

Using the examples found on the MSDN website, I successfully wrote code that
transfers files via ftp.

HOWEVER, it does not transfer compressed (zip) files properly. After
transfer, when opening the zip I get an error message that says "The
Compressed (zipped) Folder is invalid or corrupted.".

Any other file transferred is just fine.

Has anyone encountered this with the FtpWebRequest method of file transfer?

Any suggestions?

TIA

SR
 
Hello SR,

Please make sure:
1. you are not using ASCII FTP transfer (needs to be binary)
2. you are not reading or writing binary files with text encoding (the
MSDN sample does this for a text file). Use System.IO.FileStream
instead.

If this doesn't help you out, some source code would help.

Regards
Philipp Fabrizio
 
Back
Top