Friday 15 June 2012

jquery - Only 1 onComplete event triggered from multiple manual uploads with Fineuploader -


I have multiple images correct. All works, my only problem occurs when I upload many images, I only get my "full" event for the first image here is my HTML:

  & Lt; Div id = "fine-uploader" & gt; Exactly uploader & lt; / Div & gt; & Lt; Div id = "triggerUploadHolder" style = "height: 28px;" & Gt; & Lt; Div id = "triggerUpload" class = "box" style = "background color: SpringGreen; width: 150px; display: none;" & Gt; & Lt; A href = "#" onclick = "Upload Trigger (); Return False;" & Gt; Upload now & lt; / A & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Img id = "attLoader" src = "~ / content / finobloder / loading. Gif" alt = "Loading ..." style = "display: none;" / & Gt; & Lt; Div id = "thumbnail-ok-uploader" & gt; & Lt; / Div & gt; @ Urach (Model Attachment in Attachment) {& lt; Div id = "@ attachment.Id" & gt; & Lt; A href = "#" onclick = "Delete Remove ('@ attachment.Id'); Return Back;" & Gt; Remove this attachment & lt; / A & gt; & Lt; A href = "@ attachment.DocUrl" target = "_ blank" & gt; & Lt; Img src = "@ attachment.DocUrl? W = 250 & amp; mode = max" alt = "" & gt; & Lt; / A & gt; & Lt; / Div & gt; }   

And here's the JavaScript that I have run to initialize my uploader:

  $ (document) .ready (function () {createUploader ();}); Upload function triggers () {uploader.uploadStoredFiles (); } Uploaders; Function createUploader () {uploader = new qq.fineUploader ({element: $ ('# fine-uploader') [0], autoUpload: false, debug: correct, request: {endpoint: '/ myController / UploadAttachment', parameter: {ObjLogId: $ ("# ObjLogModel_Id"). Val ()}} Validation: {Permitted Extensions: ['JPG', 'JPG', 'GIF', 'PNG'], Size Limit: 1024000, Item Limit: 5 }, Message: {}, text: {uploadButton: "Click here or drag a file from your computer", draggenon: "Drop file here to upload", Cancel button: "Cancel!"}, Template: '& lt; Div class = "qq-uploader span12" & gt; '+' & lt; div class = "qq-upload-button btn btn-success" style = "width: auto; color: red;" & gt; {uploadButtonText} & Lt; / div & gt; '+' & lt; Former Class = "QC-upload-drop span12 span12"> gt;  {dragZoneText}  & lt; ; / Pre> '+' & lt; span class = "qq-drop-processing"> gt; & lt; span & gt; & lt; / span & gt; & lt; span class = "qq-drop -processing-spinner "& gt; & lt; / span & gt; & Lt; / Span & gt; '+' & Lt; Ul class = "qq-upload-list" style = "margin-top: 10px; text-align: center;" & Gt; & Lt; / Ul & gt; '+' & Lt; / Div> ', Callback: {onSubmit: function (id, name) {$ ("# triggerUpload"). FadeIn (); // console.log ("onsites:" + + + + "+"); }, Cancel: function (id, name) {// console.log ("on-connect:" + + + "+ +"); Var submittedFileCount = uploader.getUploads ({status: qq.status.SUBMITTED}) Length; If (submitfilecount == 0) {$ ("# triggerUpload"). FadeOut (); } // console.log ("submitfilecount:" + submitted filename); }, OnUpload: function (id, name) {// console.log ("onUpload:" + id + "" + name); . $ ("#TriggerUpload") fadeOut (); $ ("# AttLoader") fadein () .; }, Full: function (id, filename, feedback JSON) {// console.log ("full - filename:" + filename + "//" + + response JSON); // console.dir (responseJSON); If (responseJSON.success) {if ($ ("$ ObjLogModel_Id"). Val () == "") {$ ("# ObjLogModel_Id"). Val (responseJSON.objLogId); History.pushState ({foo: "bar"}, "saved", feedback JSON.objLogId + "/"); } $ ("#trodeler") FadeOut (); $ ('# Thumbnail-ok-uploader'). Prepaid ('& lt; div id = "' + responseJSON.Id + '" & gt; & lt; a href = "#" onclick = "Delete Delete ("' + responseJSON.Id + ''); Return Lies ; "Gt; remove this attachment & lt; / a & gt; & lt; a href =" '+ responseJSON.url +' "target =" _ blank "& gt; & lt; img src =" '+ responseJSON .url + '? W = 250 & amp; mode = maximum "alt ="' + filename + '"& gt; & lt; / a & gt; & lt; / div & gt;'); uploader.reset }}}}}};}   

Should I get a completely different event for each upload or with a different response from just one server?

Thanks!

I spoke I have done many days after asking for the integration, so I can answer the best of your question.

To answer your question directly: Yes, you get full callback for each upload. You probably can not get any callback due to the fact that you are calling the reset () API method on the uploader in your call end callback. Perhaps you do not understand what this method does. Take a look at the documentation for clarification. I suspect it is not what you want to do.

No comments:

Post a Comment