SWFUpload works in IE, but not in Firefox

后端 未结 7 1582
隐瞒了意图╮
隐瞒了意图╮ 2020-12-10 08:23

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 o

相关标签:
7条回答
  • 2020-12-10 08:25

    Just wanted to confirm that the same problem was just fixed by adding post_params variable to the SWFUpload init.

    post_params : {
        PHPSESSID : '<?=session_id()?>'
    },
    
    0 讨论(0)
  • 2020-12-10 08:26

    I found the answer ... finally. I was struggling with this for a very long time. Can't believe this is the answer. The reason is SUBST.

    I have a computer with SSD drive and since it is 256GB only I decided not to partition it. However I like split between C and D partitions and I emulated it on my SSD drive via subst command. If I pickup the file from the drive which is created with subst command, the swf upload doesn't work. I almost can't believe that, but it is a fact I finally discovered today being unable to upload files on my development computer only.

    0 讨论(0)
  • 2020-12-10 08:31

    http://demo.swfupload.org/Documentation/

    Cookie issue

    On Windows the Non-IE Flash Player plugin (FireFox, Opera, Safari, etc) will send the IE cookies regardless of the browser used. This breaks authentication and sessions for many server-side scripting technologies.

    Developers should manually pass Session and Authentication cookie information and manually restore Sessions on the Server Side if they wish to use Sessions

    The SWFUpload package contains work-around sample code for PHP and ASP.Net

    ===== Implementing some once off authentication ticket from there will make things work fine

    You can also make it conditional that this authentication is only applied when users are using the upload

    However, some test to ensure that the authentication cookie does not get around the other part of the site maybe important depending on how you issue the cookie for this action.

    0 讨论(0)
  • 2020-12-10 08:35

    It sounds like you could be running into this Flash bug. Nort's solution is the way most people have been working around it. Depending on your language/framework however, you may need to add some additional server-side code to take the session variable from the url and force it to be used as the current session.

    You can try the solution in this StackOverflow question, or try googling something like 'flash upload cookie'.

    0 讨论(0)
  • 2020-12-10 08:37

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

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

    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.

    The css I used is as follows:

    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; }
    
    0 讨论(0)
  • 2020-12-10 08:45

    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.

    0 讨论(0)
提交回复
热议问题