Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 10th, 2007, 12:59 AM
Registered User
 
Join Date: Feb 2007
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old April 10th, 2007, 07:46 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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
Reply With Quote
  #3 (permalink)  
Old April 10th, 2007, 11:16 PM
Registered User
 
Join Date: Feb 2007
Location: , , .
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

Reply With Quote
  #4 (permalink)  
Old April 11th, 2007, 08:54 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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
Reply With Quote
  #5 (permalink)  
Old June 14th, 2007, 02:18 AM
Authorized User
 
Join Date: Jun 2007
Location: , , .
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:54 AM.


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