How can I update the "storage" var set in uploadify? I have this function set_path that updates the var combined to other values that is launched when some content is selected
$(document).ready(function () {
$('#uploader').uploadify({
'uploader': '/admin/includes/uploadify/uploadify.swf',
'script': '/admin/includes/uploadify/uploadify_storage.php',
'scriptData': {
'sessionId': sessionId
},
'cancelImg': '/admin/includes/uploadify/cancel.png',
'buttonImg': '/site_images/button.png',
'folder': storage,
'auto': false,
'multi': true,
'fileExt': '*.jpg',
'simUploadLimit': 2,
'wmode': 'transparent',
'onComplete': function (event, ID, fileObj, name, response, data) {
alert(storage);
}
});
$("#start").click(function () {
$("#uploader").uploadifyUpload();
});
})
var absolute_path = "/admin/storage/files/";
var path = "";
var storage = absolute_path + path;
function set_path(new_path) {
storage = absolute_path + new_path;
show_path(new_path);
}
if set_path is launched the new storage var is updated infact the alert in "onComplete" shows the right content, the problem is that 'folder': storage contains the original "storage", and is not getting updated when setting a new path. Why?