Solved

Creating compressed file form app?

Posted on 1998-02-16
7
141 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
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now