-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Request Entity Too Large #710
Comments
Ah yes this should be much improved. I think the body parser is actually being used in Meteor core too. In the next major version of IR you can add connect middleware directly to the router and I won't be adding any middleware by default. So that might fix this issue. But if Meteor is already including bodyParser middleware upstream, then I guess you'd have to configure that too. As a short-term hack, can you configure the bodyParser middleware after it's been initialized? And just get to it through the connectHandlers array? I'll try to see if that's possible. |
Meh looks hard to set the options after the fact. I'm not sure why we force using this middleware anyway. I would take a PR to devel to remove it. That way you can set it up yourself using WebApp.connectHandlers.use(...). |
This is fixed in the refactor branch where you can add your own middleware. Due to be released sometime around the Meteor 0.9 release. |
This is still in the refactor branch, right? |
Any timeframe on this? |
@cmather This is still now working right? |
Any updates on this? |
@gerwinbrunner yes I think you can add your own middleware with a line line
|
@tmeasday It seems that this feature is only available in a version that is not yet available thru the regular packaging system. Can you point me to some resource on how I can easily add a package directly from a github url? Is there an easy way? I did the following command:
So is there something similar to add a package with an github url?
Or what is the easiest way for me to use this feature you mentioned above? Thanks, P.S.: Sorry if this is a stupid question, but I was not able to find any good solution yet. |
Hey @gerwinbrunner - sorry. You can install the latest pre-release of IR 1.0 with |
@tmeasday Thanks. I'll give it a try. |
@tmeasday: Just tried it with version 1.0.1 and I get the following error:
A call to Do I need to do something else? |
I also tried this: And it gave me this error:
|
try
|
@tmeasday
Any ideas? |
I think maybe it's a different body parser you need @gerwinbrunner ? I don't really know too much about this but by the sounds of it "urlencoded" probably doesn't deal with the body of the request? |
I got it working by forking iron:router and changing the file
Just adding the line in my own code did not fix the error, so I had to fork and change the original. |
I'm running into this issue as well. Any chance we can up the limit in iron router? |
+1. Trying to upload 3 images as base64 (i save to s3 on server) but limit wont allow Clarification: I have the upload and everything working with small files, just having problems with the limit. |
@gerwinbrunner has the right idea. But you can put this in Router.configureBodyParsers on the server. Look in lib/router_server.js for how it's done in source. Here's an example: Router.configureBodyParsers = function () {
Router.onBeforeAction(Iron.Router.bodyParser.json({limit: '10mb'});
}; For uploading files, @DirkStevens can you show an example of how to do it? We worked on an example together. I haven't had time to properly integrate multipart uploading. Under the hood Iron Router just uses body parser for parsing http bodies. And at some point they decided not to support multipart uploads (I didn't realize this until last weekend). So we have to plug in a third party multipart uploading Connect middleware package, or you can do it yourself. There are a few npm packages for this (http://www.senchalabs.org/connect/multipart.html). |
@cmather , just as @gerwinbrunner mentioned...
adding this to my own server side code doesn't seem to make a difference. I still get the limit error. Any ideas why defining it in our own code wouldn't work? OK, I figured it out...My orginal code that did NOT work was...
I needed to just add the limit to the
THIS WORKS! |
@travisdahl |
AH I found: I didnt know that it needs class of Iron.Router..that is fix now..thanks |
For people who still encounter this issue after adding the above snippet from @kkm (minus the not-needed Move your I believe this is because the |
We are trying to do some json parsing with a large file in a server route and run into this problem: "Error: Request Entity Too Large"
Instead of having to manually edit the package code it would be nice to have some kind of way to set the bodyParser limit in the configuration.
(same issue as here: http://stackoverflow.com/questions/23899209/setting-request-limit-in-a-meteor-js-app)
All help greatly appreciated.
The text was updated successfully, but these errors were encountered: