6

I'm trying to upload a 36MB zip file to Virus Total using their public API in NodeJS using request. I'm currently coming across this issue when trying to upload and can't figure out what to do next to fix it. Their API doesn't state any file size limit, and their frontend uploader specifies a 128MB upload 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>

Code is straight forward and simple, but really don't 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);
});
Dustin
  • 5,457
  • 18
  • 53
  • 82

2 Answers2

1

The VirusTotal file/scan API call is limited to 32MB. If you have a good use case for scanning large files you can ask VirusTotal for access to another API call for larger files which can can files up to 200MB.

karl
  • 165
  • 9
0

Express adds a limit over the size of http request body 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}));

Rahul jain
  • 39
  • 2