@@ -37,21 +37,21 @@ imageRouter.post('/uploadimage', function (req, res) {
37
37
form . keepExtensions = true
38
38
39
39
form . parse ( req , function ( err , fields , files ) {
40
- if ( err || ! files . image || ! files . image . path ) {
40
+ if ( err || ! files . image || ! files . image . filepath ) {
41
41
response . errorForbidden ( req , res )
42
42
} else {
43
43
if ( config . debug ) {
44
44
logger . info ( 'SERVER received uploadimage: ' + JSON . stringify ( files . image ) )
45
45
}
46
46
47
- if ( ! checkImageValid ( files . image . path ) ) {
47
+ if ( ! checkImageValid ( files . image . filepath ) ) {
48
48
return response . errorForbidden ( req , res )
49
49
}
50
50
51
51
const uploadProvider = require ( './' + config . imageUploadType )
52
- uploadProvider . uploadImage ( files . image . path , function ( err , url ) {
52
+ uploadProvider . uploadImage ( files . image . filepath , function ( err , url ) {
53
53
// remove temporary upload file, and ignore any error
54
- fs . unlink ( files . image . path , ( ) => { } )
54
+ fs . unlink ( files . image . filepath , ( ) => { } )
55
55
if ( err !== null ) {
56
56
logger . error ( err )
57
57
return res . status ( 500 ) . end ( 'upload image error' )
@@ -62,4 +62,4 @@ imageRouter.post('/uploadimage', function (req, res) {
62
62
} )
63
63
}
64
64
} )
65
- } )
65
+ } )
0 commit comments