danialfarid / ng-file-upload

Lightweight Angular directive to upload files with optional FileAPI shim for cross browser support
MIT License
7.87k stars 1.59k forks source link

IE9 upload doesn't work, having difficulty parsing debug logs for more info. #1798

Open charlesdeuter opened 7 years ago

charlesdeuter commented 7 years ago
LOG: FlashAPI.state: awaiting 
LOG: (flash -> js).log: storeKey=5090615022050727353072930307296040_2.0.7 
LOG: (flash -> js).log: timeout=0 
LOG: FlashAPI.state: ready 
LOG: FlashAPI.event.mouseenter: [object Object] 
LOG: (js -> flash).multiple: true 
LOG: (js -> flash).onError: Error 
LOG: (js -> flash).accept: art,bm,bmp,dwg,dxf,cbr,cbz,fif,fpx,gif,ico,iefs,jfif,jpe,jpeg,jpg,jps,jut,mcf,nap,nif,pbm,pcx,pgm,pict,pm,png,pnm,qif,qtif,ras,rast,rf,rp,svf,tga,tif,tiff,xbm,xpm,xwd,ART,BM,BMP,DWG,DXF,CBR,CBZ,FIF,FPX,GIF,ICO,IEFS,JFIF,JPE,JPEG,JPG,JPS,JUT,MCF,NAP,NIF,PBM,PCX,PGM,PICT,PM,PNG,PNM,QIF,QTIF,RAS,RAST,RF,RP,SVF,TGA,TIF,TIFF,XBM,XPM,XWD 
LOG: (js -> flash).onError: Error 
LOG: (js -> flash).multiple: true 
LOG: (js -> flash).onError: Error 
LOG: (js -> flash).accept: art,bm,bmp,dwg,dxf,cbr,cbz,fif,fpx,gif,ico,iefs,jfif,jpe,jpeg,jpg,jps,jut,mcf,nap,nif,pbm,pcx,pgm,pict,pm,png,pnm,qif,qtif,ras,rast,rf,rp,svf,tga,tif,tiff,xbm,xpm,xwd,ART,BM,BMP,DWG,DXF,CBR,CBZ,FIF,FPX,GIF,ICO,IEFS,JFIF,JPE,JPEG,JPG,JPS,JUT,MCF,NAP,NIF,PBM,PCX,PGM,PICT,PM,PNG,PNM,QIF,QTIF,RAS,RAST,RF,RP,SVF,TGA,TIF,TIFF,XBM,XPM,XWD 
LOG: (js -> flash).onError: Error 
LOG: FlashAPI.event.mouseDown: [object Object] 
LOG: FlashAPI.event.select: [object Object] 
LOG: FlashAPI.Form.toData 
LOG: FlashAPI.XHR._send: fileapi14817587854852 -> 14817587933943 
LOG: (js -> flash).upload: [object Object] 
LOG: (js -> flash).onError: Error 
LOG: (js -> flash).upload: [object Object] 
LOG: (js -> flash).onError: Error 

IE9. Using babel to transpile from IE9

import '../node_modules/ng-file-upload/dist/ng-file-upload-shim';
import angular from 'angular';
import ngFileUpload from 'ng-file-upload';

and I have the fileApi files in my index.html.

<script>
    //optional need to be loaded before angular-file-upload-shim(.min).js
    FileAPI = {
        debug: true,
//                forceLoad: true,
//                html5: false, //to debug flash in HTML5 browsers
        jsUrl: 'https://cdnjs.cloudflare.com/ajax/libs/danialfarid-angular-file-upload/12.2.13/FileAPI.js',
        flashUrl: 'https://cdnjs.cloudflare.com/ajax/libs/danialfarid-angular-file-upload/12.2.13/FileAPI.flash.swf',
    };
</script>
<button
    type="button"
    class="button--md add-files"
    ng-model="$ctrl.pendingFiles"
    ngf-multiple="true"
    ngf-pattern="'image/*,application/pdf'"
    ngf-accept="'image/*,application/pdf'"
    ngf-capture="'camera'"
    ngf-max-files="$ctrl.maxFiles"
    ngf-max-size="$ctrl.maxFileSize"
    ngf-keep="'true'"
    ngf-select>
      Submit
</button>

This works fine in chrome, IE10, IE11.

Hard for me to even determine what is happening since the error logs don't have any details that I can figure out.

I've determined that whatever is happening is after Upload.upload() is called within the controller.

danialfarid commented 7 years ago

There is LOG: (js -> flash).onError: Error line which probably means your server returns an error. If you use a network monitoring or look into your server logs you can see what is happening on the server side.