Solved

Zipping A File

Posted on 2002-06-24
10
183 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
ID: 7103894
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
ID: 7103969
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
ID: 7104034
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 18

Expert Comment

by:bobbit31
ID: 7104037
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
ID: 7104500
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
 
LVL 9

Expert Comment

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

Accepted Solution

by:
msdixon earned 55 total points
ID: 7104534
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
ID: 7104767
msdixon, you are my hero.  Will you marry me?
0
 
LVL 9

Expert Comment

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

Author Comment

by:Danimal
ID: 7104827
I am not even going there!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

713 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