Solved

Zipping A File

Posted on 2002-06-24
10
185 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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 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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month11 days, 10 hours left to enroll

623 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