Hi I have a directory in my website and it has directories, sub-directories and files. I want to compress them in a zip file. For example, I have this folder (named Backup) in my website: http://mysite.com/backup Code (markup): It has 2 folders and a file: test1 test2 file.php I want to compress "Backup" folder in a zip file. and the zip file will be like this: test1 test2 file.php I tried some zip classes but it makes the zip file like this: Backup --> ||||||||||test1 ||||||||||test2 ||||||||||file.php I don't want to add "Backup" folder in the zip file, I only want to add its contents. Do you have a good zip class doing what I want? Thanks
Can you tell us the libraries that you have not had success with? I've used PHP's standard zip functions with success before. Also, do you have access to your server? If you do it would be better to have a server program do this opposed to a high level scripting language.
I tried PCLZIP. It works great but there is the problem that I explained above. I tried PHP functions: http://www.php.net/manual/en/book.zip.php Code (markup): But they didn't work. I'm trying to zip files on AppServ but later I will upload it to vps.
Dont use PHP for this if you have a VPS. Find a computer based zipping program and work with that, it will work faster and more reliably. I recommend the command line version of 7-zip.
The problem is the vps is not for me, it's for my friend. I used some of its space to make something. Anyway, I solved the problem. Thanks