Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NodeJS - Upload ~36MB file to VirusTotal failing

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);
});
like image 402
Dustin Avatar asked May 17 '15 02:05

Dustin


1 Answers

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.

like image 73
karl Avatar answered Oct 27 '22 19:10

karl