我试图让SWFUpload的一个图像正常上传到我的服务器,与必须附带图像其他职位数据一起。 有一个表格填满数据,以便用户点击浏览按钮,并选择自己的图像文件后,图像不上传的时候了。 它被保存在队列中,直到用户点击发送按钮,然后我打电话mySwfUploadInstance.startUpload(),以便上传开始。
但它在功能swfupload.js的452线悲惨失败“callFlash”:
Uncaught Call to ReturnUploadStart failed
被抓住的异常之前抛出这个错误是:
Object #<HTMLObjectElement> has no method 'CallFunction'
在下面的功能:
SWFUpload.prototype.callFlash = function (functionName, argumentArray) {
argumentArray = argumentArray || [];
var movieElement = this.getMovieElement();
var returnValue, returnString;
// Flash's 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看起来就像是一个有效的flash对象。
如果我叫startUpload()我通过初始化的SWFUpload时file_dialog_complete_handler函数内我没有得到这个错误:
function ImageFileDialogComplete(numFilesSelected, numFilesQueued)
{
try
{
this.startUpload();
}
catch (ex)
{
this.debug(ex);
}
}
我真的需要能够推迟上传当用户完成表格,然后点击发送按钮。
任何想法有什么不对的SWFUpload当我打电话startUpload()从对话框完整的处理程序?