Re: [Cppcms-users] cppcms::widgets::file is always not set
Brought to you by:
artyom-beilis
From: CN <cn...@gr...> - 2010-11-01 06:06:33
|
On Sun, 31 Oct 2010 18:19:49 +0800, Artyom <art...@ya...> wrote: > Two points: > > 1. Make sure you add the file widget to the form by using: > > *this + uploaded_file > or > > > add(uploaded_file) > > 2. Make sure you use enctype="multipart/form-data" in your form. i.e. > > <form method="post" action="URL" enctype="multipart/form-data" > > <% form as_p info %> > </form> > > Because you can't upload file using regular "post" using > default encoding "application/x-www-form-urlencoded" I have added everything you suggested. Now I get "503 - Service Not Available". My cppCMS application appears to have failed to catch the posted form sent from browser. My problem perhaps fall in the realm of web server administration instead of cppCMS, but helps are greatly appreciated. This comes from Opera's source inspection: <html> <body> <h1>Upload your file</h1> <form method="post" action="http://localhost/upload" enctype="multipart/form-data" accept-charset="UTF-8"> <p>Name: <span class="cppcms_form_input"><input type="text" name="_1" ></span></p> <p><span class="cppcms_form_input"><input type="file" name="_2" ></span></p> <p><span class="cppcms_form_input"><input type="submit" name="_3" value="Upload" ></span></p> </form> </body> <html> No error is logged by my cppCMS application. The following two lighttpd log entries appear after the web page is opened by browser: 2010-11-01 13:35:30: (mod_fastcgi.c.2979) got proc: pid: 0 socket: unix:/tmp/cppcms-socket load: 1 2010-11-01 13:35:30: (mod_fastcgi.c.1508) released proc: pid: 0 socket: unix:/tmp/cppcms-socket load: 0 The following entries are added to lighttpd log after I submit the form in browser. 2010-11-01 13:35:38: (mod_fastcgi.c.2979) got proc: pid: 0 socket: unix:/tmp/cppcms-socket load: 1 2010-11-01 13:35:38: (mod_fastcgi.c.3041) write failed: Broken pipe 32 2010-11-01 13:35:38: (mod_fastcgi.c.1508) released proc: pid: 0 socket: unix:/tmp/cppcms-socket load: 0 Privileges look fine, too: # ls -l /tmp/cppcms-socket srwxrwxrwx 1 www-data www-data 0 2010-11-01 12:39 /tmp/cppcms-socket Regards, CN |