File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed
Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 3232 * Supported by browser?
3333 * @type {boolean }
3434 */
35+
36+ // ie10 +
37+ // ie 不能通过formdata上传0kb的文件
38+ // 所以还是采用传统的方式
39+ var ie10 = window . navigator . msPointerEnabled ;
40+
3541this . support = (
3642typeof File !== 'undefined' &&
3743typeof Blob !== 'undefined' &&
4046! ! Blob . prototype . slice || ! ! Blob . prototype . webkitSlice || ! ! Blob . prototype . mozSlice ||
4147false
4248) // slicing files support
49+ && ! ie10
4350) ;
4451
52+
4553if ( ! this . support ) {
4654return ;
4755}
540548totalDone += file . progress ( ) * file . size ;
541549totalSize += file . size ;
542550} ) ;
543- return totalSize > 0 ? totalDone / totalSize : 1 ;
551+ return totalSize > 0 ? totalDone / totalSize :
552+ this . isComplete ( ) ? 1 : 0 ;
544553} ,
545554
546555/**
10351044totalDone += file . progress ( ) * file . size ;
10361045totalSize += file . size ;
10371046} ) ;
1038- return totalSize > 0 ? totalDone / totalSize : 1 ;
1047+ return totalSize > 0 ? totalDone / totalSize :
1048+ this . isComplete ( ) ? 1 : 0 ; ;
10391049} ,
10401050
10411051/**
Original file line number Diff line number Diff line change @@ -319,7 +319,7 @@ function FustyFlowFile(flowObj, element) {
319319$ . error = true ;
320320$ . maxsized = true ;
321321$ . abort ( ) ;
322- $ . flowObj . fire ( 'fileError' , $ , error ) ;
322+ $ . flowObj . fire ( 'fileError' , $ , 'upload err' ) ;
323323$ . flowObj . upload ( ) ;
324324return ;
325325}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ require([
2121
2222. run ( [ '$rootScope' , function ( $rootScope ) {
2323
24- $rootScope . target = ''
24+ $rootScope . target = '/ '
2525$rootScope . flowObj = {
2626flow : null
2727} ;
@@ -44,10 +44,11 @@ require([
4444} ;
4545$rootScope . fileSuccess = function ( $file , $message ) {
4646var id ;
47- $message = angular . fromJson ( $message ) ;
47+ // $message = angular.fromJson($message);
4848// do ...
4949} ;
5050var parse2N = function ( num ) {
51+ if ( ! num ) return '0'
5152var k1 , k2 ;
5253k1 = 1024 * 1024 * 1024 ;
5354k2 = 1024 * 1024 ;
You can’t perform that action at this time.
0 commit comments