homepage Welcome to WebmasterWorld Guest from 54.163.139.36
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
omit the folders from zip command
phparion

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 3621161 posted 7:33 pm on Apr 7, 2008 (gmt 0)

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

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved