Wrox Programmer Forums
|
.NET Framework 3.5 For discussion of the Microsoft .NET Framework 3.5.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 3.5 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 December 16th, 2008, 06:12 PM
Registered User
 
Join Date: Nov 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Writing gzip file into a local file

I am ttying to write a gzip file that I have ftped from a server to a file so that it can be unzipped. When I use the code below to write the file into a local file, there are no errors but I cannot uncompress the file with a seperate gzip application or using the gzip class I created inside my application.
Code:
SW = "ftp://192.168.17.16/"
dir = ""
Un = "truecallpcmd"
pw = "tcftp"
Dim strd AsString
Dim ftpd As FtpWebRequest = FtpWebRequest.Create(SW & dir & FN)
ftpd.Credentials = New NetworkCredential(Un, pw)
ftpd.Method = WebRequestMethods.Ftp.DownloadFile
ftpd.UseBinary = True
Dim srd AsNew StreamReader(ftpd.GetResponse().GetResponseStream())
Dim fs AsNew FileStream("c:\GZ\Mylogx.gz", FileMode.OpenOrCreate, FileAccess.Write)
Dim writer AsNew BinaryWriter(fs)
 
writer.BaseStream.Seek(0, SeekOrigin.End)
 
DoWhile srd.EndOfStream <> True
writer.Write(srd.Read)
Loop
writer.Flush()
writer.Close()

Last edited by canoun; December 16th, 2008 at 06:13 PM.. Reason: add code tags





Similar Threads
Thread Thread Starter Forum Replies Last Post
writing into a file in linux file system anboss XSLT 6 June 19th, 2008 01:56 PM
How can i import a local text file into a jsp file ravibabu Java GUI 1 April 25th, 2007 04:05 AM
Writing to Text File striker9 ASP.NET 2.0 Basics 1 May 12th, 2006 05:17 AM
File Writing Performance [email protected] Classic ASP Professional 2 May 21st, 2004 05:32 PM
Get UNC for a local file Mitch Access 0 August 12th, 2003 02:24 PM





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