tomitrescak/meteor-uploads

validateRequest not sending callback to client

Closed this issue · 4 comments

I'm able to get the req headers in the validateRequest callback, but then it goes no where. The client just hangs at 0% completed and there doesn't seem to be a proper error sent back in order to handle the request validation.

You need to return the description of the error if there is an error, then the error will be displayed in the Progress bar:

validateRequest: function(request) {
      return "This is error message";
    }

leads to:

screen shot 2016-03-15 at 18 56 45

Thanks Tomi, my original reason for the problem doesn't seem to fit.

Here's my code:

        validateRequest: function(req) {
            if (req.headers["content-length"] > 1000) {
                return "File is too long!";
            }
            return null;
        },

With a small file, it looks good.
screen shot 2016-03-15 at 11 28 30 am

However anything over 2 MB will just hang:
screen shot 2016-03-15 at 11 28 58 am

I am also seeing this