V
V
Victor Diditsky2015-03-24 22:20:55
PHP
Victor Diditsky, 2015-03-24 22:20:55

How to create an archive and add files to it using php c saving access rights to added files?

Hello.
Based on the conditions of my task, I need to create an archive and add a set of files to it. This is pretty easy to solve with ZipArchive.
But the problem is that when adding files and then unzipping, the file permissions are not saved. That is, the source files have rights 777, the files from the archive have 644.
How can I create an archive while maintaining file access rights? Perhaps there are some libraries that allow you to do this, I will be glad to any solution.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin, 2015-03-27
@GhostSt92

Permissions are stored in .tar archives, which can then be ziped, as is often done, .tar.gz extensions are not uncommon.
How to create such an archive, the article will tell you, and especially the comments to it: Working with tar and gz archives using PHP

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question