diff --git a/lib/ftp.js b/lib/ftp.js index 0409627..54fe2cf 100644 --- a/lib/ftp.js +++ b/lib/ftp.js @@ -26,7 +26,11 @@ module.exports = { } - file.pipe( stream, { end: true } ); + if ( file.isStream() ) { + file.contents.pipe( stream ); + } else if ( file.isBuffer() ) { + stream.end( file.contents ); + } // ensure that parent directory exists self.mkdirp( Path.dirname( path ), onParent );