Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 29, 2012 07:38 PM by AWAlger
Member
16 Points
12 Posts
Jun 29, 2012 12:08 PM|LINK
Here is my code that i am using, the code post to a handler and works great with IE. Any help will be highly appreciated.
var filename; var filetype; $("#taskpoolUpload").unbind().bind('click', function() { hideErrorMessage("divUploadError"); $("#tbTitle").attr({ "value": "" }); $("#divUploadContainer").html("<div id='divUpload'></div>"); $.fn.colorbox({ transition: "none", width: "600px", inline: true, href: "#divUploadDocument", overlayClose: false, open: true }); filename = ""; filetype = ""; var fileSelected = false; var cancelImg = serverVariables.appBase + 'App_Themes/' + serverVariables.theme + '/images/delete.gif' $("#divUpload").uploadify({ 'uploader': serverVariables.appBase + 'scripts/uploadify.swf', 'script': actionPlanUrl, 'auto': false, 'preventCaching': true, 'cancelImg': cancelImg, 'queueSizeLimit': '90', 'sizeLimit': 4000000, 'fileExt': '*.jpg;*.gif;*.png', 'multi': false, // not to permit selection of more than one file 'buttonText': serverVariables.Browse, 'onSelect': function(event, ID, fileObj) { hideErrorMessage("divUploadError"); filename = fileObj.name; filetype = fileObj.type; fileSelected = true; }, 'onCancel': function(event, ID, fileObj, data) { fileSelected = false; }, 'onError': function() { fileOK = false; window.alert(serverVariables["DocumentUploadFailedError"]); $("#divUpload").uploadifyClearQueue(); } }); $("#divUploadContainer .cancel").attr({ "display": "none" }); $("#btnUpload").unbind('click').bind('click', function() { hideErrorMessage("divUploadError"); var title = $("#tbTitle").val(); if (title == "") { showErrorMessage("divUploadError", serverVariables.TitleEmptyError); } else if (fileSelected !== true) { showErrorMessage("divUploadError", serverVariables.NoFileSelectedError); } else { var params = { "command": "UPLOAD", "title": encodeURIComponent(title), "nameoffile": encodeURIComponent(filename), "filetype": filetype, "category": $("#cbCategory").val() }; $("#divUpload").uploadifySettings("scriptData", params); $("#divUpload").uploadifyUpload(); $.fn.colorbox.close(); //getDocuments(); } }); $(".closedialog").unbind('click').bind('click', function() { $.fn.colorbox.close(); }); });
Contributor
2531 Points
540 Posts
Jun 29, 2012 07:38 PM|LINK
is Flash installed on Chrome and Firefox?
Coding is like life, learn from the past and work towards the future, trying to redo past code, ends in lost time and nothing new accomplished.
piusn
Member
16 Points
12 Posts
Uploadify not working on Firefox and Chrome, but works on IE
Jun 29, 2012 12:08 PM|LINK
Here is my code that i am using, the code post to a handler and works great with IE. Any help will be highly appreciated.
var filename;
var filetype;
$("#taskpoolUpload").unbind().bind('click', function() {
hideErrorMessage("divUploadError");
$("#tbTitle").attr({ "value": "" });
$("#divUploadContainer").html("<div id='divUpload'></div>");
$.fn.colorbox({ transition: "none", width: "600px", inline: true, href: "#divUploadDocument", overlayClose: false, open: true });
filename = "";
filetype = "";
var fileSelected = false;
var cancelImg = serverVariables.appBase + 'App_Themes/' + serverVariables.theme + '/images/delete.gif'
$("#divUpload").uploadify({
'uploader': serverVariables.appBase + 'scripts/uploadify.swf',
'script': actionPlanUrl,
'auto': false,
'preventCaching': true,
'cancelImg': cancelImg,
'queueSizeLimit': '90',
'sizeLimit': 4000000,
'fileExt': '*.jpg;*.gif;*.png',
'multi': false, // not to permit selection of more than one file
'buttonText': serverVariables.Browse,
'onSelect': function(event, ID, fileObj) {
hideErrorMessage("divUploadError");
filename = fileObj.name;
filetype = fileObj.type;
fileSelected = true;
},
'onCancel': function(event, ID, fileObj, data) {
fileSelected = false;
},
'onError': function() {
fileOK = false;
window.alert(serverVariables["DocumentUploadFailedError"]);
$("#divUpload").uploadifyClearQueue();
}
});
$("#divUploadContainer .cancel").attr({ "display": "none" });
$("#btnUpload").unbind('click').bind('click', function() {
hideErrorMessage("divUploadError");
var title = $("#tbTitle").val();
if (title == "") {
showErrorMessage("divUploadError", serverVariables.TitleEmptyError);
} else if (fileSelected !== true) {
showErrorMessage("divUploadError", serverVariables.NoFileSelectedError);
} else {
var params = { "command": "UPLOAD", "title": encodeURIComponent(title), "nameoffile": encodeURIComponent(filename), "filetype": filetype, "category": $("#cbCategory").val() };
$("#divUpload").uploadifySettings("scriptData", params);
$("#divUpload").uploadifyUpload();
$.fn.colorbox.close();
//getDocuments();
}
});
$(".closedialog").unbind('click').bind('click', function() {
$.fn.colorbox.close();
});
});
AWAlger
Contributor
2531 Points
540 Posts
Re: Uploadify not working on Firefox and Chrome, but works on IE
Jun 29, 2012 07:38 PM|LINK
is Flash installed on Chrome and Firefox?
Coding is like life, learn from the past and work towards the future, trying to redo past code, ends in lost time and nothing new accomplished.
Don't forget to mark Answer!!!!!!!