7
awsサーバにファイルをアップロードするためにnodejsを使用しています。ファイルサイズが正しくないことがわかりました。私は2.1KBを得ています。私は私のAWSバケットにファイル名を得た、けれどもストリーミングs3がawsファイルを正常に作成できない
は、ここに私のコード
var uploadFile = function (fileReadStream, awsHeader, cb) {
//set options for the streaming module
var options = {
concurrentParts: 2,
waitTime: 20000,
retries: 2,
maxPartSize: 10 * 1024 * 1024
};
//call stream function to upload the file to s3
var uploader = new streamingS3(fileReadStream, config.aws.accessKey, config.aws.secretKey, awsHeader, options);
//start uploading
uploader.begin();// important if callback not provided.
// handle these functions
uploader.on('data', function (bytesRead) {
//console.log(bytesRead, ' bytes read.');
});
uploader.on('part', function (number) {
//console.log('Part ', number, ' uploaded.');
});
// All parts uploaded, but upload not yet acknowledged.
uploader.on('uploaded', function (stats) {
//console.log('Upload stats: ', stats);
});
uploader.on('finished', function (response, stats) {
console.log(response);
cb(null, response);
});
uploader.on('error', function (err) {
console.log('Upload error: ', err);
cb(err);
});
};
です。しかし、私はそれが失敗したと言うファイルを開こうとします。
私は、URLからこのファイルをアップロードしようとしています:https://arxiv.org/pdf/1701.00003.pdf
任意の提案をしてください?
おかげ
: - 上記のコードを使用しているときにのみ、私はそのURLに問題が発生しています。今すぐプロジェクトが完了しましたコードを変更するためのポイントがありません –
上記のコードの問題点は教えてください。 –