Maybe you should add the mime type as well?
Something like (not tested):
if(variables[part->disp_params->name+".mimetype"] &&
arrayp(variables[part->disp_params->name+".mimetype"]))
variables[part->disp_params->name+".mimetype"] +=
({part->disp_params->mimetype});
/erikThis is a response to: http://lists.lysator.liu.se/pipermail/pike-devel/2011-October/014499.html
