SWFUpload 在 IE 中有效,但在 Firefox 中无效 [英] SWFUpload works in IE, but not in Firefox

查看:42
本文介绍了SWFUpload 在 IE 中有效,但在 Firefox 中无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 SWFUpload v2.2、Firefox 3、IE 8、Flash 10在我的 ASP.NET 应用程序中,upload.aspx 正在处理所有上传(我在设置对象中设置了正确的 upload_url).在 IE 8 中,上传会到达 upload.aspx 页面并被处理,但在 Firefox 中则不会.有什么建议?

Using SWFUpload v2.2, Firefox 3, IE 8, Flash 10 In my ASP.NET application all uploads are being processed by upload.aspx (I have the correct upload_url set in the settings object). In IE 8 the uploads hit the upload.aspx page and are processed, but in Firefox they do not. Any suggestions?

用户为上传文件而访问的页面的大部分代码都显示在此处(注意:正在使用母版页):

Most of the code for the page that the user visits to upload a file is shown here (note: master pages are being used):

<script type="text/javascript" src="../swfupload/swfupload.js"></script>

<script type="text/javascript" src="../js/handlers.js"></script>

<script type="text/javascript">
    var swfu;
    window.onload = function() {
        swfu = new SWFUpload({
            // Backend Settings
            upload_url: "../upload.aspx",
            post_params: {
                "ASPSESSID": "<%=Session.SessionID %>"
            },

            // File Upload Settings
            file_size_limit: "10 MB",
            file_types: "*.*",
            file_types_description: "All Files",
            file_upload_limit: 1,
            file_queue_limit: 1,
            //assume_success_timeout: 60,

            // Event Handler Settings - these functions as defined in Handlers.js
            //  The handlers are not part of SWFUpload but are part of my website and control how
            //  my website reacts to the SWFUpload events.
            file_queue_error_handler: fileQueueError,
            file_dialog_complete_handler: fileDialogComplete,
            upload_progress_handler: uploadProgress,
            upload_error_handler: uploadError,
            upload_success_handler: uploadSuccess,
            upload_complete_handler: uploadComplete,

            // Button settings
            button_image_url: "../Images/XPButtonNoText_160x22.png",
            button_placeholder_id: "spanButtonPlaceholder",
            button_width: 160,
            button_height: 22,
            button_text: '<span class="button">Upload File<span class="buttonSmall">(10 MB Max)</span></span>',
            button_text_style: '.button { font-family: Helvetica, Arial, sans-serif; font-size: 14pt; } .buttonSmall { font-size: 10pt; }',
            button_text_top_padding: 1,
            button_text_left_padding: 5,

            // Flash Settings
            flash_url: "../swfupload/swfupload.swf", // Relative to this file

            custom_settings: {
                upload_target: "divFileProgressContainer"
            },

            // Debug Settings
            debug: false
        });
    }
</script>

推荐答案

也尝试在其他浏览器中,例如 Safari 或 Chrome.

Try in another browser too, such as Safari or Chrome.

如果它仅适用于 IE,则可能是其他答案提到的 Flash Cookie Bug.

If it works only in IE, it's probably the Flash Cookie Bug the other answers mention.

如果它适用于除 Firefox 之外的所有内容,则可能是没有为进度条定义 css.我不知道为什么这会导致问题,但我发现确实如此.一旦我将示例样式放入我的 css 文件中,它就开始在 Firefox 中工作.

If it works in everything except Firefox, it could be that there's no css defined for the progress bar. I don't know why this causes a problem, but I found that it did. As soon as I put the sample styles into my css file, it started working in Firefox.

我使用的css如下:

DIV.ProgressBar { width: 100px; padding: 0; border: 1px solid black; margin-right: 1em; height:.75em; margin-left:1em; display:-moz-inline-stack; display:inline-block; zoom:1; *display:inline; }
DIV.ProgressBar DIV { background-color: Green; font-size: 1pt; height:100%; float:left; }
SPAN.asyncUploader OBJECT { position: relative; top: 5px; left: 10px; }

这篇关于SWFUpload 在 IE 中有效,但在 Firefox 中无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆