summaryrefslogtreecommitdiffstats
path: root/lib/batch.lib.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-11-22 17:44:10 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-11-22 17:44:10 +0000
commit67cbb218cd89ac6be9d1d55ca3799080daac1f5a (patch)
tree9aabddaed61a0bda1e477cf44c69400d1590779f /lib/batch.lib.php
parentd5ae71f551f0aebef1dbae518a116a1c86430ffb (diff)
downloadampache-67cbb218cd89ac6be9d1d55ca3799080daac1f5a.tar.gz
ampache-67cbb218cd89ac6be9d1d55ca3799080daac1f5a.tar.bz2
ampache-67cbb218cd89ac6be9d1d55ca3799080daac1f5a.zip
renamed xml-rpc acl to rpc, added default mime type of image/jpg and added config options for batch download to the fs, no garbage collection for non-completed downloads yet.
Diffstat (limited to 'lib/batch.lib.php')
-rw-r--r--lib/batch.lib.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/batch.lib.php b/lib/batch.lib.php
index c49e04a4..ae919767 100644
--- a/lib/batch.lib.php
+++ b/lib/batch.lib.php
@@ -50,11 +50,27 @@ function get_song_files($song_ids) {
*/
function send_zip( $name, $song_files ) {
+ // Check if they want to save it to a file, if so then make sure they've got
+ // a defined path as well and that it's writeable
+ if (Config::get('file_zip_download') && Config::get('file_zip_path')) {
+ // Check writeable
+ if (!is_writable(Config::get('file_zip_path'))) {
+ $in_memory = '1';
+ debug_event('Error','File Zip Path:' . Config::get('file_zip_path') . ' is not writeable','1');
+ }
+ else {
+ $in_memory = '0';
+ $basedir = Config::get('file_zip_path');
+ }
+
+ } // if file downloads
+
/* Require needed library */
require_once Config::get('prefix') . '/modules/archive/archive.lib.php';
$arc = new zip_file( $name . ".zip" );
$options = array(
- 'inmemory' => 1, // create archive in memory
+ 'inmemory' => $in_memory, // create archive in memory
+ 'basedir' => $basedir,
'storepaths' => 0, // only store file name, not full path
'level' => 0 // no compression
);