File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,11 @@ module.exports = function (options) {
5959 map = { } ,
6060 counter = 1 ,
6161 redirect ,
62+ userId ,
6263 finish = _ . bind ( function ( ) {
6364 if ( ! -- counter ) {
6465 _ . each ( files , function ( fileInfo ) {
66+ fileInfo . ownerId = userId ;
6567 this . initUrls ( fileInfo ) ;
6668 this . emit ( 'end' , fileInfo ) ;
6769 } , this ) ;
@@ -76,14 +78,19 @@ module.exports = function (options) {
7678 . on ( 'fileBegin' , function ( name , file ) {
7779 tmpFiles . push ( file . path ) ;
7880 var fileInfo = new FileInfo ( file ) ;
81+ fileInfo . uploadType = options . uploadType ;
82+ // fileInfo.ownerId = this.req.user.id;
7983 fileInfo . safeName ( ) ;
8084 map [ path . basename ( file . path ) ] = fileInfo ;
8185 files . push ( fileInfo ) ;
8286 self . emit ( 'begin' , fileInfo ) ;
8387 } )
8488 . on ( 'field' , function ( name , value ) {
89+ console . log ( 'name: ' + name + ' value ' + value ) ;
8590 if ( name === 'redirect' ) {
8691 redirect = value ;
92+ } else if ( name === 'userId' ) {
93+ userId = value ;
8794 }
8895 } )
8996 . on ( 'file' , function ( name , file ) {
You can’t perform that action at this time.
0 commit comments