We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Plugin: MX Zip ( EE1 / EE2 )

Development and Programming

Max Lazar's avatar
Max Lazar
341 posts
16 years ago
Max Lazar's avatar Max Lazar

Expression Engine 2 version is ready.

       
Jarno F's avatar
Jarno F
20 posts
16 years ago
Jarno F's avatar Jarno F

It’s a great plugin! Too bad archives dont open on mac.

       
Max Lazar's avatar
Max Lazar
341 posts
16 years ago
Max Lazar's avatar Max Lazar

? I thinks is not the problem Mac/Windows/*nix will be. Archives must opened. Which version do you use(EE1.6.x or EE2)? + could you please send(by PM) me the example of you archive.

       
Brooks Seymore's avatar
Brooks Seymore
106 posts
about 16 years ago
Brooks Seymore's avatar Brooks Seymore

Let me know, Max, if you still need a .zip archive which cannot be opened on a Mac. I have one made with Zip 0.7.1 running on an ExpressionEngine 1.6.8 install which will not open on a MacBook Pro running Mac OS X 10.6.3. I was able to open it with the third-party app, The Unarchiver, but that isn’t ideal.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
about 16 years ago
Mark Bowen's avatar Mark Bowen

Yep unfortunately I’ve had this happen too. If you open the ZIP using something like Stuffit Archive Manager or anything else then the file opens fine but just not as a normal ZIP file using Archive Manager unfortunately.

Best wishes,

Mark

       
Brooks Seymore's avatar
Brooks Seymore
106 posts
about 16 years ago
Brooks Seymore's avatar Brooks Seymore

Have you experimented with alternatives, Mark? Any that will open on Macs?

After using The Unarchiver to open the .zip, I compressed the unzipped folder using the built-in archive feature on Snow Leopard.. The difference in file size was a mere 8 KB – that is 152 KB for the MX Zip version and 160 KB for the Snow Leopard compressed version.

       
Max Lazar's avatar
Max Lazar
341 posts
about 16 years ago
Max Lazar's avatar Max Lazar

Hello, could you please check version in attachment?

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
about 16 years ago
Mark Bowen's avatar Mark Bowen
Hello, could you please check version in attachment?

That one works absolutely fine 😊 What was it then?

Best wishes,

Mark

       
Max Lazar's avatar
Max Lazar
341 posts
about 16 years ago
Max Lazar's avatar Max Lazar

I heard that Mac built-in archive is very sensible to any “not-format information” in archive. Possible that the old version was include into the archive body some php note messages. So, I just cleaning up the zip class and delete all additional information.

       
Brooks Seymore's avatar
Brooks Seymore
106 posts
about 16 years ago
Brooks Seymore's avatar Brooks Seymore

Just gave it a test, Max, and the archive now opens with the built-in Archive Utility on 10.6.3! Thanks for getting this fixed so quickly!

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
about 16 years ago
Mark Bowen's avatar Mark Bowen

Yep absolutely excellent work from an ExpressionEngine rock-star if you ask me.

Thanks again Max.

Best wishes,

Mark

       
Brooks Seymore's avatar
Brooks Seymore
106 posts
about 16 years ago
Brooks Seymore's avatar Brooks Seymore

Now that I’m at the stage of my project where I use this, beyond just confirming the archives will unzip properly, I’m running into a dead end.

I’m trying to use MX Zip to create a bundle of PDF files. The bundles are compiled through the PDF Group weblog. The PDF Group contains one FF Matrix 1.3.5 field – {content_pdf_menu} – which uses a Playa 3 dropdown menu – {pdf_file} – to pull the PDFs from a separate PDF weblog where individual PDF files are uploaded via the nGen File Field.

The code I have below works – that is it goes to the {content_pdf_menu} and archives the PDF file from the {pdf_file} drop down. However, it only archives the last item. That is, in my PDF Group entry, I have three PDF files: one.pdf, two.pdf, and three.pdf. When I loop through the FF Matrix / Playa field, only three.pdf is zipped.

In the top block, the code which generate the PDF, you’ll notice I also use the Find and Replace 1.3 plugin to remove the leading slash from the directory name. I found that if I don’t use that plugin what is returned is a 22 B (yes, byte) zip archive which expands into a zip.cpgz document.

The second block outputs a list of the three PDF files stored in the FF Matrix. Since the top block does archive a related entry, sourced from the FF Matrix / Playa combination, I’m guessing this is an error that results from MX Zip not handling loops very well?

exp:weblog:entries weblog="pdf_group" limit="1" disable="categories|member_data|trackbacks"}

{content_pdf_menu} {!-- FF Matrix --}
{exp:zip direct_output="no" folder="pdf/bundles" filename="{url_title}.zip" store_full_path="no"}
{pdf_file} {!-- Playa custom field within FF Matrix --}
{zip:files}         
[{exp:replace find="/pdf" replace="pdf"}{content_pdf}{/exp:replace}]
{/zip:files}
{/pdf_file}
{/exp:zip}
{/content_pdf_menu}

<a href="/pdf/bundles/{url_title}.zip">Download Bundle</a>

{!-- output list of PDF files contained within the {content_pdf_menu} field frame --}

{content_pdf_menu}
{pdf_file}
{exp:replace find="/pdf" replace="pdf"}{content_pdf}{/exp:replace}

{/pdf_file}
{/content_pdf_menu}

{/exp:weblog:entries}
       
Max Lazar's avatar
Max Lazar
341 posts
about 16 years ago
Max Lazar's avatar Max Lazar

try to change your code this way

exp:weblog:entries weblog="pdf_group" limit="1" disable="categories|member_data|trackbacks" parse="inward"}

UPDATE and did you try to change this way?

{!-- FF Matrix --}
{exp:zip direct_output="no" folder="pdf/bundles" filename="{url_title}.zip" store_full_path="no"}
{content_pdf_menu} 
{pdf_file} {!-- Playa custom field within FF Matrix --}
{zip:files}         
[{exp:replace find="/pdf" replace="pdf"}{content_pdf}{/exp:replace}]
{/zip:files}
{/pdf_file}
{/content_pdf_menu}
{/exp:zip}
       
Brooks Seymore's avatar
Brooks Seymore
106 posts
about 16 years ago
Brooks Seymore's avatar Brooks Seymore

Max, thanks again for helping out…

Same outcome in both cases, just one file was archived. Only difference was which file was archived… in your version the first item was the one zipped; in mine it was the third item. Adding the parse=inward parameter to the exp:weblog:entries tag didn’t alter the output in either version..

       
Max Lazar's avatar
Max Lazar
341 posts
about 16 years ago
Max Lazar's avatar Max Lazar

sorry, I was little bit disoriented with tags, try this way

{exp:zip direct_output="no" folder="pdf/bundles" filename="{url_title}.zip" store_full_path="no"}
{zip:files}    
{content_pdf_menu}
{pdf_file} {!-- Playa custom field within FF Matrix --}
[{exp:replace find="/pdf" replace="pdf"}{content_pdf}{/exp:replace}]
{/pdf_file}
{/content_pdf_menu}{/zip:files}
{/exp:zip}
       
1 2 3 4

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.