Forum Moderators: bakedjake
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