2015-01-17 4 views
0

npm streaming-S3을 사용하고 S3에 비디오를 업로드하고 싶습니다. 그래서 내 node.js 응용 프로그램에서 다음 코드를 사용합니다.<Object>에는 'CreateReadStream'메서드가 없습니다.

<Object has no method 'CreateReadStream'> :

var streamingS3 = require('streaming-s3'), 
    fs = require('fs'); 
var fStream = fs.CreateReadStream(__dirname + '/video.mp4'); 
var uploader = new streamingS3(fStream, {accessKeyId: process.env['AWS_ACCESS_KEY_ID'], secretAccessKey: secretAccessKey: process.env['AWS_SECRET_ACCESS_KEY']}, 
    { 
    Bucket: 'example.streaming-s3.com', 
    Key: 'video.mp4', 
    ContentType: 'video/mp4' 
    }, function (err, resp, stats) { 
    if (err) return console.log('Upload error: ', e); 
    console.log('Upload stats: ', stats); 
    console.log('Upload successful: ', resp); 
    } 
); 

이 코드를 실행 한 후 나는 다음과 같은 오류가 발생했습니다.

귀하의 대답은 가치가 있습니다.

답변

2

노드 fs 모듈에 CreateReadStream 메서드가 없습니다. createReadStream (첫 번째 문자는 소문자 여야합니다.) :

var fStream = fs.createReadStream(__dirname + '/video.mp4'); 
관련 문제