in reply to Re^2: Upload file- Ajax+Perl
in thread Upload file- Ajax+Perl

Finally, this worked for me. But why CGI is not used here?

Because the guy who wrote it is naive/ignorant.

Does that mean I need to send all the other data via http headers, for example if I send a form with multiple fields and files?

No. If your server program is running under CGI use CGI module for getting at the data.

Replies are listed 'Best First'.
Re^4: Upload file- Ajax+Perl
by romanegloo (Initiate) on Jul 12, 2016 at 18:03 UTC
    Right, the body of the request can be accessed via CGI. I used $cgi->param('POSTDATA') to save the uploaded file.