Handling multipart/form-data requests via Apache Module
Handling multipart/form-data requests via Apache Module
am 20.01.2010 19:07:02 von Jain Sachinkumar
Hello,
We are interested in logging HTTP requests that are sent to web
applications hosted on the Apache web server. Eventually, as part of a
larger research project, we would like to be able to replay these requests
automatically on the web application. For this purpose, we have developed
an Apache module which logs HTTP GET and POST requests and associated data
in a seperate file. In this module, I am able to log data that is
associated with a POST request, but I am having difficulty handling
multipart/form-data requests and was hoping I could get some help from the
community on this.
Consider for example, the following form
upload.html
uploader.php
This is the php script which will handles the file that is sent through
the HTML page.
In our logger, we already have the functionality to log the 'lname',
'uploadedfile' fields and their values. But, in addition to the file's
name which comes as a value of the 'uplaodedfile' form field, we would
like to get the file's contents as well. We would like to save the file to
a predetermined location, for e.g., if the user uploads a zip file, we
would like the logger to store the zip file before passing it on to the
web application.
Is there a way to get the file contents in a logger software that is
sitting on Apache between the user and the web application. Any
suggestions/advice would be appreciated.
Regards,
- Sachin Jain
Research Assistant,
Information Systems Department,
University of Maryland, Baltimore County
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Handling multipart/form-data requests via Apache
am 20.01.2010 23:42:02 von Devraj Mukherjee
If you can access the POST data then it should be a matter of decoding
the mime string and get the multipart data out.
Are you writing your module in C, Perl or Python?
On Thu, Jan 21, 2010 at 5:07 AM, Jain Sachinkumar wrote:
> Hello,
>
> We are interested in logging HTTP requests that are sent to web
> applications hosted on the Apache web server. Eventually, as part of a
> larger research project, we would like to be able to replay these request=
s
> automatically on the web application. For this purpose, we have developed
> an Apache module which logs HTTP GET and POST requests and associated dat=
a
> in a seperate file. In this module, I am able to log data that is
> associated with a POST request, but I am having difficulty handling
> multipart/form-data requests and was hoping I could get some help from th=
e
> community on this.
>
> Consider for example, the following form
>
> upload.html
>
OST">
> Last Name: =A0
> Choose a file to upload:
/>
>
>
>
> uploader.php
> This is the php script which will handles the file that is sent through
> the HTML page.
>
> In our logger, we already have the functionality to log the 'lname',
> 'uploadedfile' fields and their values. But, in addition to the file's
> name which comes as a value of the 'uplaodedfile' form field, we would
> like to get the file's contents as well. We would like to save the file t=
o
> a predetermined location, for e.g., if the user uploads a zip file, we
> would like the logger to store the zip file before passing it on to the
> web application.
>
> Is there a way to get the file contents in a logger software that is
> sitting on Apache between the user and the web application. Any
> suggestions/advice would be appreciated.
>
> Regards,
> - Sachin Jain
> Research Assistant,
> Information Systems Department,
> University of Maryland, Baltimore County
>
>
>
> ------------------------------------------------------------ ---------
> The official User-To-User support forum of the Apache HTTP Server Project=
..
> See for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> =A0 " =A0 from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
--=20
Follow me on Twitter, http://twitter.com/mdevraj
"The secret impresses no-one, the trick you use it for is everything"
- Alfred Borden (The Prestiege)
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Handling multipart/form-data requests via Apache Module
am 21.01.2010 20:02:03 von Jain Sachinkumar
Hello Devraj,
Thanks for the quick response.
I am using C to write my module.
Can you give me some guideline to decode the mime string? If the contents
of multipart data is just text file, it is easy to read it and write to
other file, but in case of zipped file or image file, how this is to be
handled?
Language is not a problem, If there is better way to do this in Perl or
Python, I can do that also.
Regards,
- Sachin Jain
> If you can access the POST data then it should be a matter of decoding
> the mime string and get the multipart data out.
>
> Are you writing your module in C, Perl or Python?
>
> On Thu, Jan 21, 2010 at 5:07 AM, Jain Sachinkumar
> wrote:
>> Hello,
>>
>> We are interested in logging HTTP requests that are sent to web
>> applications hosted on the Apache web server. Eventually, as part of a
>> larger research project, we would like to be able to replay these
>> requests
>> automatically on the web application. For this purpose, we have
>> developed
>> an Apache module which logs HTTP GET and POST requests and associated
>> data
>> in a seperate file. In this module, I am able to log data that is
>> associated with a POST request, but I am having difficulty handling
>> multipart/form-data requests and was hoping I could get some help from
>> the
>> community on this.
>>
>> Consider for example, the following form
>>
>> upload.html
>>
>>
>> uploader.php
>> This is the php script which will handles the file that is sent through
>> the HTML page.
>>
>> In our logger, we already have the functionality to log the 'lname',
>> 'uploadedfile' fields and their values. But, in addition to the file's
>> name which comes as a value of the 'uplaodedfile' form field, we would
>> like to get the file's contents as well. We would like to save the file
>> to
>> a predetermined location, for e.g., if the user uploads a zip file, we
>> would like the logger to store the zip file before passing it on to the
>> web application.
>>
>> Is there a way to get the file contents in a logger software that is
>> sitting on Apache between the user and the web application. Any
>> suggestions/advice would be appreciated.
>>
>> Regards,
>> - Sachin Jain
>> Research Assistant,
>> Information Systems Department,
>> University of Maryland, Baltimore County
>>
>>
>>
>> ------------------------------------------------------------ ---------
>> The official User-To-User support forum of the Apache HTTP Server
>> Project.
>> See for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> " from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>
>
>
> --
> Follow me on Twitter, http://twitter.com/mdevraj
>
> "The secret impresses no-one, the trick you use it for is everything"
> - Alfred Borden (The Prestiege)
>
> ------------------------------------------------------------ ---------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org