Re: File upload

2006-02-25 Thread Franky Braem


Try instead
  LoadFile C:/Path/to/Apache2/bin/libarpeq2.dll
  LoadModule apreq_module modules/mod_apreq2.so



I get the following now:

C:\Program Files\apachefriends\xampp\apache\binapache
Syntax error on line 177 of C:/Program 
Files/apachefriends/xampp/apache/conf/httpd.conf:
Cannot load libapreq2.dll into server: The specified module could not be 
found.




Re: File upload

2006-02-24 Thread Franky Braem

Joe Schaefer wrote:

Franky Braem [EMAIL PROTECTED] writes:



Is there a step by step tutorial on how to implement a file upload in
an Apache module with apreq2? I'm trying to write mod_wxjs (JavaScript
and wxWidgets as server side script, more info on
wxjs.sourceforge.net) and I want to add a file upload functionality
(something like php). 






Something like this:

  #include httpd.h
  #include apreq_module.h
  #include apreq_param.h
  #include apreq_module_apache2.h
  #include apreq_util.h

  apreq_handle_t *req;
  apreq_param_t *param;
  request_rec *r;

  ... initialize r ...

  req = apreq_handle_apache2(r);

  param = apreq_body_get(req, name of upload widget);

  if (param == NULL) {
 /* error: missing field */
  }
  else if (param-upload == NULL) {
 /* error: widget not an upload */
  }
  else {

 /* have upload field */

 apr_table_t *info;  /* upload headers */
 apr_bucket_brigade *bb; /* upload contents */
 apr_bucket_t *e;

 info = param-info;
 /* DO SOMETHING with info */

 bb = apr_brigade_create(r-pool, r-connection-bucket_alloc);
 apreq_brigade_copy(bb, param-upload);

 while ((e = APR_BRIGADE_FIRST(bb)) != APR_BRIGADE_SENTINEL(bb)) {
 apr_size_t dlen;
 const char *data;
 apr_status_t s;
 
 /* apr_bucket_read() has side effects on spool buckets, which

  * is why we read from a copy of the brigade - to conserve memory
  */
 s = apr_bucket_read(e, data, dlen, APR_BLOCK_READ);

 if (s != APR_SUCCESS) {
 /* error: bad bucket read */
 break;
 }
 else {
 /* DO SOMETHING with data, dlen */
 }

 apr_bucket_delete(e);
 }

  }




I'm trying to integrate apreq2 into wxJS, but I get the following crash 
when trying to handle a request:


	apreq2.dll!apreq_filter_relocate(ap_filter_t * f=0x)  Line 48 
+ 0x3 bytes	C
 	apreq2.dll!get_apreq_filter(apreq_handle_t * handle=0x05b20938)  Line 
45 + 0xc bytes	C
 	apreq2.dll!apreq_handle_apache2(request_rec * r=0x015aaad0)  Line 435 
+ 0x9 bytes	C
 	mod_wxjs.dll!wxjs_handler(request_rec * r=0x015aaad0)  Line 287 + 
0x9 bytes	C++

[EMAIL PROTECTED]()  + 0x1f bytes   


Is it possible to build libapreq2 with Visual Studio Express 2005?



Re: File upload

2006-02-24 Thread Franky Braem

Randy Kobes wrote:

It should be possible - is that what you're using? If you are, you 
should ensure everything else (httpd, apr, ...) was also built with the 
same compiler - there are known problems mixing, for example, things 
compiled with VC++ 7 with those of VC++ 6.




I've got the following in my httpd.conf:

LoadFile modules/mod_apreq2.so
LoadModule wxjs_module 
D:/development/wxJS2/src/mod_wxjs/debug/mod_wxjs.dll


But I still get an error message when starting Apache:

C:\Program Files\apachefriends\xampp\apache\binapache
Syntax error on line 177 of C:/Program 
Files/apachefriends/xampp/apache/conf/httpd.conf:
Cannot load modules/mod_apreq2.so into server: The specified module 
could not be found.


Any idea which module can't be found?

Franky.