blueimp/jQuery-File-Upload — Issue #950: Dynamic directory
Author: jamkelvl
Created: 2012-01-16 20:14:14+00:00
State: open

I believe this may have been covered before, but here goes:

I'm wondering how to have this wonderful uploader crawl dynamic directories?

As of right now I can upload to dynamic directories, but it will not crawl the proper directory.

My code is...

function __construct($options=null) {
$this->options = array(
'script_url' => $this->getFullUrl().'/'.basename(__FILE__),
'upload_dir' => dirname(__FILE__).'/../../../'.$_POST['dir'].'/',
'upload_url' => $this->getFullUrl().'/../../../'.$_POST['dir'].'/',
'param_name' => 'files',
// The php.ini settings upload_max_filesize and post_max_size
// take precedence over the following max_file_size setting:
'max_file_size' => null,
'min_file_size' => 1,
'accept_file_types' => '/.+$/i',
'max_number_of_files' => null,
// Set the following option to false to enable non-multipart uploads:
'discard_aborted_uploads' => true,
// Set to true to rotate images based on EXIF meta data, if available:
'orient_image' => false,
'image_versions' => array(
// Uncomment the following version to restrict the size of
// uploaded images. You can also add additional versions with
// their own upload directories:
/*
'large' => array(
'upload_dir' => dirname(__FILE__).'/files/',
'upload_url' => dirname($_SERVER['PHP_SELF']).'/files/',
'max_width' => 1920,
'max_height' => 1200
),
*/
'thumbnail' => array(
'upload_dir' => dirname(__FILE__).'/thumbnails/',
'upload_url' => $this->getFullUrl().'/thumbnails/',
'max_width' => 200,
'max_height' => 200
)
)
);
if ($options) {
$this->options = array_replace_recursive($this->options, $options);
}
}

What's the best solution to this?