Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Zipping A File

Posted on 2002-06-24
10
Medium Priority
?
190 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
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 220 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…
Suggested Courses
Course of the Month11 days, 10 hours left to enroll

916 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