Solved

Creating compressed file form app?

Posted on 1998-02-16
7
150 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

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month3 days, 20 hours left to enroll

630 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