SWFUpload works in IE, but not in Firefox

Xolamee picture Xolamee · Feb 10, 2010 · Viewed 14.4k times · Source

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>

Answer

therufa picture therufa · Jun 4, 2010

I know, its an old post, but maybe it will help to solve the problem for some people, because i had the same problem today.

I solved this problem not with using the post array, because i don't know how, and where to debug this script, but with generating a querystring

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

            //And here comes the highlight

            use_query_string : true,

            //code ...

After this you will get a querystring like this: ?SessionID=(id)&OtherID=(otherid)

This works with guarantee under every browser.