Overview
Features
Download
Documentation
Community
Add-Ons & Services

HTMLForm::setFieldLimit and file upload

Please post support and help requests here.

HTMLForm::setFieldLimit and file upload

Postby budric » 24 Apr 2012, 23:50

Hi,

I use HTMLForm to handle multipart file upload.
Code: Select all
void TransmitFileHandler::handleRequest(Poco::Net::HTTPServerRequest & request, Poco::Net::HTTPServerResponse& response)
{
   try
   {
      FilePartHandler fileHandler;                                              //my handler
      HTMLForm form(request, request.stream(), fileHandler);
...


In version 1.4.3 you guys introduced a field limit of 100 for security reason, and now my code is breaking for cases with 100 files and form fields submitted. The problem is I can't call setFieldLimit() because the HTMLForm constructor calls load() where field limit exception is thrown from. So by the time HTMLForm object is constructed it has already used its field limit of 100.

Am I using HTMLForm wrong? How can I fix my code to work with new 1.4.3 POCO? Do you plan to patch HTMLForm to specify field limit in the constructor?

Thanks.
budric
 
Posts: 24
Joined: 13 May 2009, 17:14

Re: HTMLForm::setFieldLimit and file upload

Postby fbraem » 25 Apr 2012, 08:02

Use the default constructor and set the limit with setFieldLimit.
After that use the load method to process the request.
Zumuta!, that's the way to do IT!
fbraem
 
Posts: 95
Joined: 11 Aug 2008, 22:47
Location: Belgium

Re: HTMLForm::setFieldLimit and file upload

Postby budric » 25 Apr 2012, 17:02

Thanks, that was easy. I panicked and though I have to setEncoding and or a bunch of other things. :oops:
budric
 
Posts: 24
Joined: 13 May 2009, 17:14


Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests