我用的是ASP来调用UPLOAD.PHP文件.
<?php
echo "<script language=javascript>alert('对不起!');</script>";
?>
而结果出来的只是DEBUG消息,没有出现信息框.
SWF DEBUG: Event: uploadSuccess: File ID: SWFUpload_0_0 Data: <body onload=javascript:alert('对不起!');>是不是因为我用的SWFUPLOAD上传软件的原因.
还是什么地方没有设置正确?
<?php
echo "<script language=javascript>alert('对不起!');</script>";
?>
而结果出来的只是DEBUG消息,没有出现信息框.
SWF DEBUG: Event: uploadSuccess: File ID: SWFUpload_0_0 Data: <body onload=javascript:alert('对不起!');>是不是因为我用的SWFUPLOAD上传软件的原因.
还是什么地方没有设置正确?
本人菜鸟,刚学PHP,望高手指点。
<script type="text/javascript">
var swfu; window.onload = function() {
var settings = {
flash_url: "swfupload/swfupload.swf",
upload_url: "upload.php", // Relative to the SWF file
post_params: { "PHPSESSID": "<?php echo session_id(); ?>" },
file_post_name: "Filedata", // 文件对象的名称,默认Filedata,可以自己改.后台接收就靠它识别
file_size_limit: "1024 MB",
file_types: "*.*",
file_types_description: "All Files",
file_upload_limit: 0,
file_queue_limit: 1,
custom_settings: {
progressTarget: "fsUploadProgress",
cancelButtonId: "btnCancel"
},
debug: true, // Button settings
button_image_url: "images/TestImageNoText_65x29.png", // Relative to the Flash file
button_width: "65",
button_height: "29",
button_placeholder_id: "spanButtonPlaceHolder",
button_text: '<span class="theFont">选择文件</span>',
button_text_style: ".theFont { font-size: 12; }",
button_text_left_padding: 12,
button_text_top_padding: 3, file_dialog_start_handler: fileDialogStart,
file_queued_handler: fileQueued,
file_queue_error_handler: fileQueueError,
file_dialog_complete_handler : fileDialogComplete, //upload_start_handler : uploadStart, // I could do some client/JavaScript validation here, but I don't need to.
upload_progress_handler: uploadProgress,
upload_error_handler: uploadError,
upload_success_handler: uploadSuccess,
upload_complete_handler: uploadComplete
}; swfu = new SWFUpload(settings);
};
</script>
找到了他的回调函数,在XXXX.PHP中让PHP返回一个值,根据传回的值在回调函数里接收来做判断,然后再在回调函数中输出相对应的ALERT信息。
已解决!