Reputation: 19
I'm using uploadify with jQuery ui tabs on an ASP.NET 3.5 page. All works fine with Chrome; when I swap tabs the uploadiify button flashes, but is there as the tab slides-in.
With Firefox (17.0.1) the tab slides in & the uploadify button is shown, it flashes off & is not shown again. I can force it to show by doing a partial page post back from an ASP: button. If I simulate the ASP: button click with jQuery it doesn't load the uploadify button.
I think it may be some kind of timing issue so I've put the uploadify() function in a settimeout() but that hasn't solved it. I thought this because if I fire an alert after the tab slides-in & the uploadify is 'binding' the uploadify button is shown.
I've tried the uploadify demo page & that's OK so it's not a problem with Firefox flash version.
Any ideas?
This is my uploadify 'binding' function - it works OK with Chrome so I figure all the paths are good. The onSWFReady was an attempt to sort this problem - no good.
function InitialiseNewUploadifyControl() {
var prefix = "Attachment_";
var auth = "<% = Request.Cookies[FormsAuthentication.FormsCookieName] == null ? string.Empty : Request.Cookies[FormsAuthentication.FormsCookieName].Value %>";
var ASPSESSID = "<%= Session.SessionID %>";
var jobId = $(".job-Id").text();
if ($('#fileInputNewUploader').length < 1) {
console.log("fileInputNewUploader : " + $('#fileInputNewUploader').length.toString());
var _log = $('#fileInputNew').uploadify({
'uploader': '/Scripts/Uploadify/uploadify.swf',
'script': 'Handlers/Upload.ashx',
'scriptData': { 'prefix': prefix, 'ASPSESSID': ASPSESSID, 'AUTHID': auth, 'JobId': jobId,
"UploadImmediate": false
},
'cancelImg': 'Scripts/Uploadify/cancel.png',
'auto': true,
'multi': true,
'fileDesc': 'All Files',
'fileExt': '*.*',
'queueSizeLimit': 10,
'sizeLimit': 4000000,
'buttonText': 'Upload Files',
'folder': '/Uploads',
'removeCompleted': false,
'onComplete': function (event, ID, fileObj, response, data) {
$("<%= ui_lblHiddenResizeControl.ClientID %>").text("false");
if (response == "0") {
alert('Sorry, the file type that was just uploaded is not allowed.');
jQuery('#fileInputNew').uploadifyCancel(ID);
} else {
$("#<%= ui_lblHiddenResizeControl.ClientID %>").text("true");
//$(".hidden-row-click").click();
}
return false;
}
/*
, 'onSWFReady': function () {
//$("#fileInputNewUploader").parent().css({ "visability": "visible", "background-color": "Gray" });
HideTopLoader();
console.log("onSWFReady_fileInputNewUploader : " + $('#fileInputNewUploader').length.toString());
if ($('.FFFix-hidden-button-click').val() === "unclicked") {
$('.FFFix-hidden-button-click').click();
console.log("onSWFReady_fileInputNewUploader click");
}
}
*/
});
console.log('%o', _log);
}
}
Upvotes: 0
Views: 911
Reputation: 19
The demos work fine so the flash player is OK. I moved to binding code to the jquery ui Tabs function/method; check which tab is selected & bind if it's the 1 I'mm after, this fixed things.. no setTimeout required.
Upvotes: 0
Reputation: 2192
I was having the same issue with FireFox, you needs to update/install Adobe Flash player for FireFox
Upvotes: 1