| Page 1 of 1 | [ 1 post ] |
|
I created a File Uploader using the following code. My backend uses Struts2 . I am using the following code to upload but my Struts action is not getting invoked. For convenince I only pasted important pieces of the code.Can someone help me with this.Also how do we return the progress from the backend?
YUI({filter:"raw"}).use("uploader", function(Y) { //Y.one("#overallProgress").set("text", "Uploader type: " + Y.Uploader.TYPE); if (Y.Uploader.TYPE != "none" && !Y.UA.ios) { var uploader = new Y.Uploader({width: "250px", height: "35px", multipleFiles: true, swfURL: "http://yui.yahooapis.com/3.5.1/build/uploader/assets/flashuploader.swf?t=" + Math.random(), simLimit: 2 }); var uploadDone = false; uploader.render("#selectFilesButtonContainer"); uploader.after("fileselect", function (event) { var fileList = event.fileList; var fileTable = Y.one("#filenames tbody"); if (fileList.length > 0 && Y.one("#nofiles")) { Y.one("#nofiles").remove(); } if (uploadDone) { uploadDone = false; fileTable.setHTML(""); } Y.each(fileList, function (fileInstance) { fileTable.append("<tr id='" + fileInstance.get("id") + "_row" + "'>" + "<td class='filename'>" + fileInstance.get("name") + "</td>" + "<td class='filesize'>" + fileInstance.get("size") + "</td>" + "<td class='percentdone'>Hasn't started yet</td>"); }); }); Y.one("#uploadFilesButton").on("click", function () { if (!uploadDone && uploader.get("fileList").length > 0) { uploader.uploadAll("http://localhost:8080/YUITest/uploadNominationDocs"); } }); } else { Y.one("#uploaderContainer").set("text", "We are sorry, but the uploader technology is not supported" + " on this platform."); } }); </script> |
| Page 1 of 1 | [ 1 post ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group