WordPress.org

Ready to get started?Download WordPress

Forums

auto zipping and delivering the theme as currently used (4 posts)

  1. pifpafpuf
    Member
    Posted 8 years ago #

    I made my own theme. To allow others to download it, I currently pack it by hand and put it on the server in a download area.

    How would I automatically zip or tar the whole theme subdirectory as it is currently used to deliver it for a download? I guess it is more a PHP question, but since I want this to work in the context of WordPress ...

  2. Mark (podz)
    Support Maven
    Posted 8 years ago #

    Not so much a php question as to what archive programs you have on your machine.

    On Windows, you could use any of the following zippers:
    http://www.pricelessware.org/thelist/fil.htm#File Compression: Zip-Unzip

  3. pifpafpuf
    Member
    Posted 8 years ago #

    No Windows, but this is not the point. I want a URL within WordPress that runs code to pack and deliver the theme directory when clicked. I think I could find the PHP code to use zlib, pack the stuff and dump it to the output, but this would result in garbled web-pages. I think what I need is to change the mime-type from text/html to something like application/zip. But where would I do this with PHP in WordPress?

  4. masquerade
    Member
    Posted 8 years ago #

    You would send a header("Content-Type: application/zip"); and use zlib to zip up the files like you said.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.