Problem transferring compressed files via System.Net.FtpWebRequest

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
 
P

Philipp

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top