Welcome to WebmasterWorld Guest from

Forum Moderators: bakedjake

Message Too Old, No Replies

omit the folders from zip command

7:33 pm on Apr 7, 2008 (gmt 0)

Senior Member from MZ 

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 9, 2005
votes: 0


I have a php script that reads files from different folders and make a zip of all those files and save it in a separate location for downloading.

I make an array of files with their full path as below


then i implode them using SPACE as

$files = implode(" ",$fileArrays);

so now i have the file names ready for zip command.

then i do like

exec("/usr/bin/zip download/arch.zip $files");

it works fine but when i download and unzip the final file it has full directory paths in it and not .txt files in the root folder.

can anybody help me please how to remove the folders and zip only files in the final file.

thank you


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members