Welcome to WebmasterWorld Guest from 54.226.62.26

Forum Moderators: bakedjake

Message Too Old, No Replies

omit the folders from zip command

     

phparion

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

WebmasterWorld Senior Member 5+ Year Member



Hi

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

/home/user/public_html/files/file.txt
/home/user/public_html/files/file2.txt
/home/user/public_html/files4/file.txt
/home/user/public_html/files7/file.txt

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

 

Featured Threads

Hot Threads This Week

Hot Threads This Month