I am trying to get SWFUpload to upload the image to my server correctly along with other messages that should appear along with the image. There is a form for filling data, so after the user clicks the browse button and selects his image file, the image does not load immediately. It is kept in the queue until the user clicks the submit button, then I will call mySwfUploadInstance.startUpload () to start the download.
But it does not cope with the error in line 452 swfupload.js in the function 'callFlash':
Uncaught Call to ReturnUploadStart failed
The exception before throwing this error is the following:
Object #<HTMLObjectElement> has no method 'CallFunction'
in the following function:
SWFUpload.prototype.callFlash = function (functionName, argumentArray) { argumentArray = argumentArray || []; var movieElement = this.getMovieElement(); var returnValue, returnString; // Flash method if calling ExternalInterface methods (code adapted from MooTools). try { returnString = movieElement.CallFunction('<invoke name="' + functionName + '" returntype="javascript">' + __flash__argumentsToXML(argumentArray, 0) + '</invoke>'); returnValue = eval(returnString); } catch (ex) { throw "Call to " + functionName + " failed"; } // Unescape file post param values if (returnValue != undefined && typeof returnValue.post === "object") { returnValue = this.unescapeFilePostParams(returnValue); } return returnValue; };
movieElement looks like a valid flash object.
I do not get this error if I call startUpload () inside the function that I pass file_dialog_complete_handler when initializing SWFUpload:
function ImageFileDialogComplete(numFilesSelected, numFilesQueued) { try { this.startUpload(); } catch (ex) { this.debug(ex); } }
I really need to be able to postpone the download before the user fills out the form and click submit.
Any idea what is wrong with SWFUPload when I call startUpload () from the full dialog handler?
source share