Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 10th, 2007, 12:59 AM
Registered User
 
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default FTP Download

While i try to download a encrypted file(e.g : .pgp file) from FTP location the file is downloaded but the size of the file is changed and when i try to decrypt the downloaded encrypted file , it gives error. The FTP download works fine when we download a normal file

 
Old April 10th, 2007, 07:46 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What do you mean by "normal" file? What defines a file as "normal"?

Is it possible that you are downloading in ASCII mode instead of BINARY for this? So your "normal" file is simply a text file which downloads correctly in ASCII mode?

-Peter
 
Old April 10th, 2007, 11:16 PM
Registered User
 
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Planoie,
I am using the below written code,
do let me know what changes i need to make

        stream = ftpResponse.GetResponseStream();
    reader = new StreamReader(stream, Encoding.UTF8);
    writer = new StreamWriter(destinationFile, false);
    writer.Write(reader.ReadToEnd());
thanks in advance
Anypond

 
Old April 11th, 2007, 08:54 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Not sure what to tell you. Your original post didn't say anything about you writting code that was doing this. I figured you were using an FTP client. I haven't worked with steams very much, so I'm not the right person to answer the question.

-Peter
 
Old June 14th, 2007, 02:18 AM
Authorized User
 
Join Date: Jun 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Anypond,

Could you please give me the code to download all the files in a directort from a FTP site.

thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
Download files from FTP dbellavi ASP.NET 1.0 and 1.1 Professional 7 July 19th, 2007 11:54 AM
Download files from FTP dbellavi C# 0 June 14th, 2007 02:16 AM
FTP Download Problem JohnEw Pro VB 6 0 September 4th, 2006 09:57 AM
How to Download the files from FTP using DTS surileo SQL Server DTS 1 September 29th, 2004 01:23 PM
Deleting file after ftp download otarboy Pro VB 6 0 September 27th, 2004 03:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.