2

I'm trying to create a web form which can be used to upload a file to parse.com and add it to a normal parse object after uploading. While parse.com supports client side file upload controller as described here, it has a disadvantage that I have to expose the JavaScript key for using it. To overcome this, I have done a little hack by converting my files into base64 strings on the client side, and add it as a body-part in my submit request, and finally convert it to a ParseFile on the server side as shown below.

var base64 = req.body.poster;
var file = new Parse.File("poster.jpg", { base64: base64 });
var featured = new Parse.Object("Object");
featured.set("poster", file);
featured.save();

While this works for all files sized less than 100KB (default body part size limit) my use case needs files sized upto 10MB to be uploaded correctly. So I have tried changing the bodyParse() body size limit as shown below.

app.use(express.bodyParser({ limit: 10000000 })); // 10MB

But this configuration doesn't appear to have any effects on the express server. And the response I get on making this request is as follows.

413 (Request Entity Too Large) 

Is there anyway that I can change the body size limit of the express server on Parse.com?

PS :- I know exposing Javascript keys are not vulnerable very much, if the ACLs are configured accordingly. But in this case, I would like to keep it this way for added security.

Subin Sebastian
  • 15,526
  • 6
  • 51
  • 56
  • Looks like a repeated question. Check this out. - http://stackoverflow.com/questions/19917401/node-js-express-request-entity-too-large – Prabhakar Kasi Jan 03 '15 at 15:28

0 Answers0