Archived Forum Post

Index of archived forum posts

Question:

I want to add directory to archive

Dec 03 '16 at 16:07

Hey!

I use method appendFiles, but I have only files in zip archive. I want to see directory in archive.

i.e.

I have files in directory_name:

-directory_name
--123.txt
--321.txt

appendFiles("directory_name", true);

I want to get in archive:

-directory_name
--123.txt
--321.txt

but I only get files:

--123.txt
--321.txt

Please, help. :) Sorry for my bad english.

Thanks


Answer

Use the zip.PathPrefix property:

Android: How to Add a Directory Path to Files when Zipping

Classic ASP: How to Add a Directory Path to Files when Zipping

C: How to Add a Directory Path to Files when Zipping

C++: How to Add a Directory Path to Files when Zipping

C#: How to Add a Directory Path to Files when Zipping

C# UWP/WinRT: How to Add a Directory Path to Files when Zipping

DataFlex: How to Add a Directory Path to Files when Zipping

Delphi ActiveX: How to Add a Directory Path to Files when Zipping

Delphi DLL: How to Add a Directory Path to Files when Zipping

.NET Core C#: How to Add a Directory Path to Files when Zipping

Excel: How to Add a Directory Path to Files when Zipping

Visual FoxPro: How to Add a Directory Path to Files when Zipping

Java: How to Add a Directory Path to Files when Zipping

Lianja: How to Add a Directory Path to Files when Zipping

MFC: How to Add a Directory Path to Files when Zipping

Mono C#: How to Add a Directory Path to Files when Zipping

Node.js: How to Add a Directory Path to Files when Zipping

Objective-C: How to Add a Directory Path to Files when Zipping

Perl: How to Add a Directory Path to Files when Zipping

PHP ActiveX: How to Add a Directory Path to Files when Zipping

PHP Extension: How to Add a Directory Path to Files when Zipping

PowerBuilder: How to Add a Directory Path to Files when Zipping

PowerShell: How to Add a Directory Path to Files when Zipping

PureBasic: How to Add a Directory Path to Files when Zipping

Python: How to Add a Directory Path to Files when Zipping

Ruby: How to Add a Directory Path to Files when Zipping

SQL Server: How to Add a Directory Path to Files when Zipping

Swift: How to Add a Directory Path to Files when Zipping

Tcl: How to Add a Directory Path to Files when Zipping

Unicode C: How to Add a Directory Path to Files when Zipping

Unicode C++: How to Add a Directory Path to Files when Zipping

Visual Basic 6.0: How to Add a Directory Path to Files when Zipping

VB.NET: How to Add a Directory Path to Files when Zipping

VB.NET UWP/WinRT: How to Add a Directory Path to Files when Zipping

VBScript: How to Add a Directory Path to Files when Zipping

Xojo Plugin: How to Add a Directory Path to Files when Zipping