3

I need to send an audio to the meteor server, but I keep getting a 413 (Request Entity Too Large)

I'm using a FileReader to read a file as a binary string and then send it to the server

const reader = new FileReader();
  reader.readAsBinaryString(file);
  reader.onload = function(fileLoadEvent) {
    Meteor.call('Action.upload',
    {
      file,
      data: reader.result,
      lang
    },
    (err,res) => {
      console.log(err, res);
    });
   };
  • Are you using a reverse proxy with nginx, apache, etc? If so, [this might help](http://craftcms.stackexchange.com/questions/2328/413-request-entity-too-large-error-with-uploading-a-file). – Adam Feb 08 '17 at 17:57
  • @Adam No, I don't – Igor Shulgan Feb 08 '17 at 19:19
  • Hmmm... well, I think the concept is the same. We need to increase the max file / body size. Not sure exactly how to do that in meteor. [Maybe this will point you in the right direction...](https://forums.meteor.com/t/request-too-large-body-empty-when-increasing-limit/15925) Also, streaming the data might be possible. This article talks about [server to client streaming, but maybe it would be useful.](https://www.sitepoint.com/introduction-to-streams/) – Adam Feb 08 '17 at 19:53

0 Answers0