Is it possible to provide HTTP multipart response (using Perl/PHP) just like multipart request? The scenario is like, I would like to provide a URL whick takes a parameter for EmployeeID, and in return the response should consist of employee's photo, latest payslip and information like name, age and address. The receiving end is not a browser, but it will be a program which gets this response and process them later. Any idea on how to do this?
To give more information on my above question, I have to provide a URL to my friend who will programmatically receive the response. For e.g. (in Perl):
$response = $ua->request($my_url)
My application is supposed to respond with not just data, but also with files! I was being asked to make it to return multipart response.
I did not now how to start with the coding itself. The google search on "multipart response" did not return pages with which I can learn and get started. However, the comment by chansen was really helpful, as well as his code sample https://gist.github.com/1391017. Thanks a lot.
I'm posing my original https://gist.github.com/1391017 as response.
Output: