0

I have a text file that contains the path to multiple files in the server, 1 file per line, is there a way to read those lines and create a zip from em?

Thanks in advance.

1
  • 1
    Read the file, read the other files, put them into a zip. Whats the problem? Commented May 20, 2012 at 20:22

1 Answer 1

2

PHP has functions for creating zips.

Here is a simple example: http://davidwalsh.name/create-zip-php

You'll need to read the file names, put them into a list, and use the function in the example.

Sign up to request clarification or add additional context in comments.

2 Comments

i checked the code and looks that is what i'm looking for, but the text file i mentioned has 500+ lines, so i need to copy/paste those lines and add em like the Sample usage? can php do it automatically with a script or function?
Read the file line by line, add each line to an array, and pass the array in as the files parameter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.