Ich benutze nodejs, um Dateien auf aws-Server hochzuladen. und festgestellt, dass die Dateigröße nicht richtig da ist. Ich bekomme 2.1KB.Streaming-s3 ist nicht korrekt uplaoding Datei zu aws
hier ist mein Code
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);
});
};
obwohl, ich Dateinamen Eimer in meinem aws bekam. aber dann versuche ich, die Datei zu öffnen, sagt es gescheitert.
Ich versuche, diese Datei von URL zu laden: https://arxiv.org/pdf/1701.00003.pdf
Anregungen bitte?
Dank
: - Ich bekomme Probleme in dieser URL nur, wenn ich mit obigen Code Doign. Jetzt ist das Projekt abgeschlossen, es gibt keinen Grund, den Code zu ändern –
Können Sie mir sagen, was ist das Problem in oben genannten Code? –