Solved

Creating compressed file form app?

Posted on 1998-02-16
7
148 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
Technology Partners: 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

Technology Partners: 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

Title # Comments Views Activity
oracle global variables 4 79
Create a path if not exists 7 107
SUM 2 INTEGER ARRAYS INTO 1 10 111
Delphi problems to abort a printjob 9 34
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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 …

740 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