VBO Mass Download

Events happening in the community are now at Drupal community events on www.drupal.org.
jmolinas's picture

How to create custom php on VBO that can mass download files and zip it before downloading?

Thank you

Comments

Create you own actions

bara.munchies's picture

http://drupal.org/node/172152

in this action you have the full node object accessible, per selected item. Now you need to find a way to store those infos (i.e. in a Session) and then redirect the user to a download url, you can zip the files from the session and create a file header for immediate download without another click.

look at php header function

bara.munchies's picture

look at php header function http://php.net/manual/en/function.header.php

you need something like this, of course zip instead of pdf

<?php
// We'll be outputting a PDF
header('Content-type: application/pdf');

// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="downloaded.pdf"');

// The PDF source is in original.pdf
readfile('original.pdf');
?>

also need php zip support http://php.net/manual/en/book.zip.php

thank you for quick reply, I

jmolinas's picture

thank you for quick reply, I found a module, latest version of VBO

Were you able to accomplish this?

gusaus's picture

This would be a great feature. Have you had any luck accomplishing this?

Gus Austin

It is already on the latest

jmolinas's picture

It is already on the latest stable of VBO , just create a file view type, there is a "Download archive of selected files" option on VBO

Apparantly not yet on Drupal 7

gusaus's picture

I posted the question here and got some nice responses - http://drupal.org/node/1222844

Thanks!

Gus Austin

I can't see "Download archive

adrianlanzi's picture

I can't see "Download archive of selected files" as an option. I've already added a file field to my view. What am I doing wrong?

Thanks

Philippines

Group organizers

Group categories

Post category

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: