NodeJS - upload ~ 36 MB file to VirusTotal failing

I am trying to upload a 36MB zip file to Total Virus using my public API in NodeJS using a request. I am currently encountering this problem when trying to download and cannot figure out what to do next to fix it. Their API does not specify a file size limit, and their third-party loader defines a 128 MB download limit.

<html><head> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <title>413 Request Entity Too Large</title> </head> <body text=#000000 bgcolor=#ffffff> <h1>Error: Request Entity Too Large</h1> <h2>Your client issued a request that was too large. </h2> <h2></h2> </body></html> 

The code is simple and simple, but I don’t really know what to do to fix it. Any help is appreciated.

 var request = require('request'); var fs = require('fs'); var formData = { file: fs.createReadStream('./path/to/file.zip'), apikey: 'public-vt-apikey' }; var options = { url: 'https://www.virustotal.com/vtapi/v2/file/scan', formData: formData }; request.post(options, function(err, res, body) { console.log(body); }); 
+6
source share
2 answers

VirusTotal file / scan API call is limited to 32 MB. If you have a good option for scanning large files, you can ask VirusTotal to access another API call for larger files that can contain files up to 200 MB in size.

+1
source

Express adds a limit to the size of the body of the HTTP request that it can handle. You need to override this. var bodyParser = require('body-parser'); app.use(bodyParser.json({limit: '50mb'})); app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));

0
source

Source: https://habr.com/ru/post/987356/


All Articles