Solved

Zipping A File

Posted on 2002-06-24
10
180 Views
Last Modified: 2010-05-02
Using VB, is there a way to grab a file off the local disk and put it into a zip file, or some other compressed format?  I am writing an app that needs to FTP a file from a local PC to a FTP server.  I know how to do that.  The problem is that the file is kinda big to send over the dialup line my client has.  Zipping would make the file transfer go a lot quicker.

Thanks.

-Dan  
0
Comment
Question by:Danimal
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 43

Expert Comment

by:TimCottee
Comment Utility
Use the Infozip libraries from http://www.info-zip.org/pub/infozip/ these create pkzip compatible archives from files that you specify. You can use these dlls in your VB project and run from there.
0
 
LVL 9

Expert Comment

by:msdixon
Comment Utility
if the client has winzip installed, they have a command line utility.
http://www.winzip.com/wzcline.htm

i've used that quite a bit. it's pretty handy.
0
 
LVL 18

Expert Comment

by:bobbit31
Comment Utility
0
 
LVL 18

Expert Comment

by:bobbit31
Comment Utility
hehe, nevermind, it's the same thing as timcottee's link (i just didn't look before posting)
0
 
LVL 1

Author Comment

by:Danimal
Comment Utility
msdixon, thank you.  That command line utility is just the ticket I think.

Unfortunately, however, I have a really stupid problem using it.  I don't know how to execute command line statements from within a VB program.  Could you (or someone) please provide me that missing piece of the puzzle?
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 9

Expert Comment

by:msdixon
Comment Utility
you'll need to use the windows scripting host.
0
 
LVL 9

Accepted Solution

by:
msdixon earned 55 total points
Comment Utility
add the reference to the project (i think it's called Microsoft Windows Scripting Host -- but i can't remember, and my version of vb is not functioning properly).

the code below zips up iis log files. strZip is the name and path of the zip file and strLog is the name and path of the log file.

-- code ---

Dim wsh As New WshShell
Dim strScript As String

strScript = """c:\program files\winzip\wzzip.exe"" """ & strZip & """ """ & strLog & """"

wsh.Run(strScript)
0
 
LVL 1

Author Comment

by:Danimal
Comment Utility
msdixon, you are my hero.  Will you marry me?
0
 
LVL 9

Expert Comment

by:msdixon
Comment Utility
i get that a lot, but i don't think my wife would appreciate that.  :-)
0
 
LVL 1

Author Comment

by:Danimal
Comment Utility
I am not even going there!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now