Solved

Creating compressed file form app?

Posted on 1998-02-16
7
144 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

810 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