Being currently working on a REST Server/Client with gSOAP in C, I have a question regarding Content-disposition header (when a multipart/form-data request is sent to my server):
What I want is to retrieve some value from a POST request that I receive. More particularly, I want the "filename" value inside the "Content-disposition" header, so that my server can correctly now the name of the file the request just sent.
For now, I'm getting the file via a post handler that retrieve and save the file (via the soap_multipart structure of gSOAP).
int http_post_multipart_handler( struct soap *ctx)
{
struct soap_multipart *content;
soap_end_recv(ctx);
for(content = ctx->mime.first; content; content = content->next)
{
if(content->id && content->ptr)
{
if(strstr(content->type, "application/zip"))
{
// Save the file
Has anybody ever worked with multipart handling in gSOAP? And has anyone ever done this?
Thanks in advance!
What I already tried is to go inside the soap_multipart structure to see if the filename value was here, but it's not. Maybe parsing the header would be helpful? Or parsing the entiere request and search for the filename value (but that sound wrong).