setFileTextSize
Added by Matt Kingston over 12 years ago
Hi there,
I'm using a WFileUpload to upload some test images. One is 130kb, the other is 230kb. If I use setFileTextSize(40) I can upload the 130kb image but not the 230kb image. I've tried a variety of other arguments (80, 100, 1000, 1000000) to setFileTextSize but nothing has allowed me to upload the 230kb file. I can't find anything in the documentation about the argument.
Any help regarding use of the setFileTextSize argument would be greatly appreciated.
Cheers,
Matt
Replies (4)
RE: setFileTextSize - Added by Derek Spenser over 12 years ago
Matt
I suspect this issue is related to the maximum request size. Have a look at the wt_config.xml file and bump up the maximum size. Posted below is the specific section.
<!-- Maximum Request Size spooled in memory (Kb)
194
195 Normally, Wt keeps incoming requests (POST data) in memory.
196 However, malicious users could send a big POST and as such
197 use up all memory of your HTTP server. With this parameter,
198 you tune how big a request can be before Wt spools it in a
199 file before processing it. Legitimate big POST messages may
200 occur when users are expected to upload files.
201
202 See also max-request-size.
203
204 The default value is 128K, which is more than enough for
205 any interactive Wt event.
206 -->
207 128
RE: setFileTextSize - Added by Matt Kingston over 12 years ago
Hi Derrek,
Fantastic, thanks very much for your response. The max-memory-request-size option is specific to ISAPI, but that lead me to the option, which solved my problem. Thank you!
RE: setFileTextSize - Added by Derek Spenser over 12 years ago
Matt
Sorry about that. The max reqest size was the setting I meant, I copied the wrong section without paying close attention. I'm glad you found it anyway. Also, right after I hit the send button I remembered the WFileUpload::fileTooLarge signal. Listening to that signal would help too.
RE: setFileTextSize - Added by Matt Kingston over 12 years ago
No biggie at all, I had a bit more of a look around in the config file and realised that setting was for the ISAPI connector and it seemed sensible there'd be an analogous one for the built-in server. Most important I think is that this piece of information now exists for anyone else that needs to find it.
Indeed I am listening to the fileTooLarge signal, thanks!
For anyone reading this, this signal is emitted when the file upload size is larger than:
- the maximum request size
- the maximum size set with setFileTextSize