alenteria / noswfupload

Automatically exported from code.google.com/p/noswfupload
0 stars 0 forks source link

Firefox 7.0 bug #11

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open demo in FF 7.0.1
2. Try to select file
3.

What is the expected output? What do you see instead?
Expected - file name showed. Output - no filename choosed

Fix
string 81 - files.item(i).fileName || files.item(i).name

Original issue reported on code.google.com by Suhoij@gmail.com on 17 Nov 2011 at 2:26

GoogleCodeExporter commented 9 years ago
hi, 
this is my fix
diff -Nup noswfupload.js.orig  noswfupload.js
--- noswfupload.js.orig 2009-03-22 13:39:46.000000000 +0100
+++ noswfupload.js  2011-10-05 13:46:58.000000000 +0200
@@ -7,6 +7,8 @@ var $ = {
      * @author          Andrea Giammarchi
      * @blog            webreflection.blogspot.com
      * @license         Mit Style License
+     *
+     * 2011-10-05 - jA FIX FF7
      */

     /**
@@ -78,6 +80,11 @@ var $ = {
             lastInput = wrap.dom.input;
             $.event.del(wrap.dom.input, "change", arguments.callee);
             for(var max = false, input = wrap.dom.input.cloneNode(true), i = 0, files = $.files(wrap.dom.input); i < files.length; i++){
+           
+           //FF 7 fix -jA 5.10.2011
+       if(!files.item(i).fileName) files.item(i).fileName=files.item(i).name;
+       if(!files.item(i).fileSize) files.item(i).fileSize=files.item(i).size;
+       
                 var value   = files.item(i).fileName || (files.item(i).fileName = files.item(i).value.split("\\").pop()),
                     ext     = -1 !== value.indexOf(".") ? value.split(".").pop().toLowerCase() : "unknown";
                 if(wrap.fileType && -1 === wrap.fileType.indexOf("*." + ext)){

Original comment by kopa...@gmail.com on 8 Dec 2011 at 7:12

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you. The above fix worked for FF 8.x Mac - before only Safari was working.

Original comment by J0n4s.H4...@googlemail.com on 13 Dec 2011 at 4:43

GoogleCodeExporter commented 9 years ago
ThX 

Original comment by mr.peter...@gmail.com on 19 Jan 2012 at 3:04

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The above edit stops it working in IE8.  Files upload ok but they are labelled 
as "test" in the upload list:
    // FF7+ fix
    // in IE8/9 files.item(i).name is "test" (form field name!), .filenName is undefined, but results/upload list works.
    // in FF11 files.item(i).name is the file name, .fileName is undefined, hence "no files selected".
//So I use the below FF7+ and IE8+, and yes probably better way to do this...
                if(files.item(i).fileName==undefined && files.item(i).name!="test"/*upload form field name*/){ 
            files.item(i).fileName=files.item(i).name;
            files.item(i).fileSize=files.item(i).size;
        }

Original comment by hakim.mi...@gmail.com on 11 Apr 2012 at 4:02

GoogleCodeExporter commented 9 years ago
Not only the file is called "test" in the upload window, also the progress bars 
run out of the window, and the indicated number of uploaded bytes is incorrect.

Original comment by eric.g.j...@gmail.com on 16 Jun 2012 at 5:25

GoogleCodeExporter commented 9 years ago
Forgot to add: plus the max file size is ignored.

Original comment by eric.g.j...@gmail.com on 16 Jun 2012 at 5:28