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

tpayton u need to use server path or relative path.

do I need add futures with options to add files by http requests?

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

Just thought I should post the errors I’m getting to the page when testing this :

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/images/uploads/1.jpg) is not within the allowed path(s): (/usr/local/psa/home/vhosts/****.co.uk/httpdocs:/tmp) in /usr/local/psa/home/vhosts/****.co.uk/httpdocs/admin/plugins/pi.zip.php on line 62 Warning: fopen() [function.fopen]: open_basedir restriction in effect. File(/test.zip) is not within the allowed path(s): (/usr/local/psa/home/vhosts/****.co.uk/httpdocs:/tmp) in /usr/local/psa/home/vhosts/****.co.uk/httpdocs/admin/plugins/pi.zip.php on line 362 Warning: fopen(/test.zip) [function.fopen]: failed to open stream: Operation not permitted in /usr/local/psa/home/vhosts/****.co.uk/httpdocs/admin/plugins/pi.zip.php on line 362 Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/psa/home/vhosts/****.co.uk/httpdocs/admin/plugins/pi.zip.php on line 363 Warning: fclose(): supplied argument is not a valid stream resource in /usr/local/psa/home/vhosts/****.co.uk/httpdocs/admin/plugins/pi.zip.php on line 364

I tried setting the code like this :

{exp:zip direct_output="true" folder="" filename="test.zip" max_size="50"}
{zip:files}/images/uploads/1.jpg{/zip:files}
{if file_limit}File Limit!{/if}
{/exp:zip}

Not really too sure where I’m going wrong on this though? Any thoughts?

Best wishes,

Mark

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

MX Zip version 0.7 release

2Mark Bowen Try the new version – I fount the bug with direct_output setting in old one (but the paramets is change, so pls. look on new example).

       
H&O's avatar
H&O
34 posts
16 years ago
H&O's avatar H&O

Hi,

I cant seem to get it to output anything. I’ve got the following code:

{exp:zip direct_output="no"}
{zip:files}
    {image_matrix backspace="1"}[/var/www/absolute_path{src}]
    {/image_matrix}
{/zip:files}
{/exp:zip}
{image_matrix backspace="1"}[/var/www/absolute_path{src}]
{/image_matrix}

outputs the following: (the paths to the files are correct)

[/var/www/absolute_path/media/images/fotoviewer.jpg][/var/www/absolute_path/media/images/fotoviewer.jpg][/var/www/absolute_path/media/images/fotoviewer.jpg][/var/www/absolute_path/media/images/fotoviewer.jpg]

The template doesn’t return anything, and doesn’t give me any errors and template debugging doesn’t trow any errors as well.

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

Paales for direct_output=”no” you need to setup output folder(folder — folder whare you want to save your zip files in direct_output=no mode). First of all, for debugging, try to use direct_output=”yes”.

p.s. did you try to check the root folder of you website for .zip file?

       
H&O's avatar
H&O
34 posts
16 years ago
H&O's avatar H&O

Hi Max,

When I set it to direct_output=”yes” I get the following url: http://domain.com/url/fotos/vrij-saai-album/, but i don’t get a filename and the browser says: File not found.

And the rootfolder doesn’t contain any files.

Paul

       
Max Lazar's avatar
Max Lazar
341 posts
16 years ago
Max Lazar's avatar Max Lazar
When I set it to direct_output=”yes” I get the following url: http://domain.com/url/fotos/vrij-saai-album/, but i don’t get a filename and the browser says: File not found.

I was update plugin. Could you please try it with direct_output=”yes”?

       
H&O's avatar
H&O
34 posts
16 years ago
H&O's avatar H&O

Hi Max,

This solves the problem and get the correct file.

Paul

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

Good to know. If you will have more issue - just tell me.

       
H&O's avatar
H&O
34 posts
16 years ago
H&O's avatar H&O

Hi,

I don’t know if your aware but your files can’t be opened with the default Mac OS X achive utility, but can be opened by a thirdparty utility.

If currently have the following template:

{exp:weblog:entries status="Open|Verborgen" require_entry="yes" disable="categories|category_fields|member_data|pagination|trackbacks"}

<h2>{title}</h2>

{exp:zip direct_output="no" folder="/var/www/vhosts/new.verdel.it/subdomains/kindkracht/httpdocs/media/files/" root_level="8" filename="{url_title}{edit_date}.zip"}
{zip:files}
    {afbeeldingen_matrix backspace="1"}[/var/www/vhosts/new.verdel.it/subdomains/kindkracht/httpdocs{src}]{/afbeeldingen_matrix}
{/zip:files}
{/exp:zip}

<a href="/media/files/{url_title}{edit_date}.zip">Download afbeeldingen als <code>.zip
bestand. {/exp:weblog:entries}</code>

This works as expected, one question though, does it cache the .zip files? If it is created once, does it recreate the file every time the template runs or does it check for the file first?

       
Max Lazar's avatar
Max Lazar
341 posts
16 years ago
Max Lazar's avatar Max Lazar
I don’t know if your aware but your files can’t be opened with the default Mac OS X achive utility, but can be opened by a thirdparty utility.

:( I will check it soon.

Hi, This works as expected, one question though, does it cache the .zip files? If it is created once, does it recreate the file every time the template runs or does it check for the file first?

Not yet. Zip created, pushed to user and deleted. But I will add cache to my future list.

       
H&O's avatar
H&O
34 posts
16 years ago
H&O's avatar H&O

I’ve changed the functionality of the plugin a bit so that the plugin checks if a file exists, this in combination with the {url}{edit_date} filename creates the caching system that is suited for my purpose.

I’ve checked it to work with the folowing code:

{exp:zip check_exists="yes" direct_output="no" folder="/absolute_path/media/files" root_level="8" filename="{url_title}{edit_date}.zip"}

note that i’ve added the check_exists parameter.

       
Gareth Davies's avatar
Gareth Davies
491 posts
16 years ago
Gareth Davies's avatar Gareth Davies

Hi,

I’m having issues with this plugin. When set to direct output = no it saves the zip file correctly but it’s empty.

When I set direct = yes I get a fatal error “Call to undefined function mime_header_encode() in pi.zip.php on line 151”

Are there any dependencies I could be missing?

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

could you please try to download the last version(0.7.1) from my web site? (my mistake - at this moment I working on website update and put the link for old version of MX Zip. sorry)

       
Gareth Davies's avatar
Gareth Davies
491 posts
16 years ago
Gareth Davies's avatar Gareth Davies

Great, thanks. That solves it.

       
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.