dump POST data to screen

H

henribaeyens

Hello,

I'm trying to figure out a way to output, for debugging purposes, the
contents of a multipart form-data. The posted data consists of both text
type inputs and file types input. In php, one can invoke print_r($_POST)
and print_r($_FILES), how do I achieve this using perl, especially for
the $_FILES data; I can do the $_POST by parsing the query string but how
do I do it for the files?

Thanks much for any help

Henri
 
G

Gunnar Hjalmarsson

henribaeyens said:
nice guru shit!

I managed to come up with

while(<STDIN>) {
chomp($_);
print "$_<br>\n";
}

You didn't mention that you are using a CGI script to inspect the data.
It's not advisable to display unparsed form data as HTML. If you are
using a browser, try this instead:

print "Content-type: text/plain\n\n", <STDIN>;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top