Topic: Problems programically adding mime_types
Im creating a file manager for my website and require to change the mime_types dependant on certain situations.
//initilise plupload
settings =
{
runtimes : 'html4,silverlight',
url : 'php/function/upload.php',
max_file_count: 20,
resize :
{
quality : 90,
crop: true
},
filters :
{
max_file_size : '1000mb',
mime_types: []
},
rename: true,
sortable: true,
dragdrop: true,
views:
{
list: true,
thumbs: true,
active: 'thumbs'
}
}
$("#uploader").plupload(settings);
//programically change url and mime_types settings.
function setUploadOptions(dir)
{
var uploader = $("#uploader").plupload('getUploader');
//this works
uploader.settings.url = 'php/function/upload.php?location='+dir;
//this does not work
uploader.settings.filters.mime_types = [{title : "application/pdf", extensions : "pdf"}];
}
I managed to update the url, but accessing the mime_types in the same way causes this error:
TypeError: e.regexp is undefined - plupload.full.min.js:28:2925
Incase this was the issue I added custom moxie extensions before initilsing plupload (I still get same error), using:
mOxie.Mime.addMimeType("application/pdf,pdf");
- How can I change (remove + add) the mime types settings in plupload after iniltilisation using js/jquery?