Solved

Creating compressed file form app?

Posted on 1998-02-16
7
149 Views
Last Modified: 2010-04-04
I want to create(compress several files) a Zip-file or some other from my app. Is it possible, how do I do it?
I use Delphi Developer 2.0...
Thanx!
Erik N
0
Comment
Question by:Erik N
[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
7 Comments
 

Author Comment

by:Erik N
ID: 1359324
Edited text of question
0
 
LVL 4

Expert Comment

by:d003303
ID: 1359325
Check for a compressing component on the DSP. There are some freeware ones available.
0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1359326
You need to zip the file with pkzip?
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 4

Expert Comment

by:itamar
ID: 1359327
Hi Erik,

use this function:

uses ...., ShellAPI; //IMPORTANT

procedure PKZIP(Files, DestFile, WorkDir:string);
var aux            : integer;
    Command, Params: string;
begin
   { convert Pascal string to Null-termintated strings }
   Command := 'PKZIP.EXE' + #0;
   Params := DestFile + ' ' + Files + #0; //Set aditional                                             parameters here
   WorkDir := WorkDir + #0;
   { run/ application/file }
   aux := ShellExecute(Application.MainForm.Handle,'Open',@Command[1],@Params[1],@WorkDir[1], 0);
   if aux < 32 Then
     MessageDlg('Could not execute'+Command,mtError,[mbOK],0);
end;

Example:

procedure TForm1.Button1Click(Sender: TObject);
begin
      PKZIP('*.sys', 'test', 'c:\');
end;

IHTH,
Itamar

P.S.: Any doubts, place a comment before rejecting the answer.
0
 

Author Comment

by:Erik N
ID: 1359328
Dear Itamar.
This worked just fine, however I want to compress the files without being dependent on some external program, like Pkzip.exe. Is this possible ?
Thank you Itamar, for your time...
/Erik N
0
 
LVL 4

Accepted Solution

by:
itamar earned 50 total points
ID: 1359329
Ok, I'll try again.

If you don't need ZIP format (as you said: "...Zip-file or some other...") you can use this third part component:

info: http://sunsite.icm.edu.pl/delphi/ftp/d10free/tlzrw1.htm 
Download: http://sunsite.icm.edu.pl/delphi/ftp/d10free/tlzrw1.zip

If you prefer ZIP files without external calling, try:

info: http://www.concentric.net/~twojags/
But this last one is in beta version and it's not free.

IHTH
0
 

Author Comment

by:Erik N
ID: 1359330
Thank you itamar !
Sorry, I wanted the ZIP-format or some other, but I didn't want to use the external call (my mistake).

/Erik N
0

Featured Post

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!

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

739 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