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
Solved

Zipping A File

Posted on 2002-06-24
10
182 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

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.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

839 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