Fyorl wrote:Code: Select all
$('#attach-panel .inner').pluploadQueue({
runtimes: 'html5'
, url: 'upload.php'
, max_file_size: '10mb'
, chunk_size: '1mb'
, unique_names: true
, filters: [
{title: 'Images', extensions: 'jpg,gif,png,webp'}
, {title: 'Archives', extensions: 'zip,rar,tar.gz,tar.bz2,7z'}
]
, resize: {width: 320, height: 240, quality: 90}
});
Commas on the right please. Also, ideally object properties and array items should always have a comma, but I think the JavaScript notation does not allow that for the last property/item.
Fyorl wrote:max_file_size can be pulled from the attachment settings section of the ACP.
Sounds good.
Fyorl wrote:Do we need another option for chunk_size?
Depends.
1. I think we have to ensure we specify plupload.chunk_size < php.post_max_size.
2. Is it better (i.e. faster or consumes less memory) to use a bigger chunk_size when post_max_size is higher and thus allows a higher chunk_size?
Fyorl wrote:The filters can be taken from the $cache->obtain_attachment_extensions() or just left blank since the server-side code will have to pass an extension check anyway.
The filters should be specified. It is quite annoying to upload big files just to then realise that the extension has been disabled.
Fyorl wrote:As for resizing, I guess that should be another option added to the control panel? Or if it's for the user's benefit then it should be possible to allow the user to select resize dimensions.
I don't think users need to be able to specify resize dimensions. I think images should just be resized to "Maximum image dimensions" (i.e. phpbb.img_max_width and phpbb.img_max_height). Those settings already exist. The thumbnail generation process can still be handled in PHP.