in reply to Re^2: Perl CGI File Upload Problem
in thread Perl CGI File Upload Problem

That is an Apache message (not CGI, not Perl). It occurs when you specify an HTML document as the action of a form (as opposed to a CGI script, for example), or when the webserver isn't set to recognize your script as executable (thus it treats it as a document, and you can't POST to a document).

Within the form, the "action" should be the url of the script, not of another HTML document. If you already have it set as such, there may be a misconfiguration in Apache where it recognizes the script as a document rather than an executable program.

See the following link: Why do I keep getting "Method Not Allowed" for form POST requests? (From the Apache FAQ).


Dave

Replies are listed 'Best First'.
Re^4: Perl CGI File Upload Problem
by Anonymous Monk on Jun 20, 2011 at 08:53 UTC

    "Within the form, the "action" should be the url of the script, not of another HTML document."

    I have used fileprocess.cgi script as the action for the form

    "there may be a misconfiguration in Apache where it recognizes the script as a document rather than an executable program"

    But when I use GET method, I'm able to create an empty file in the same name as the local file selected in the server

      Now is the time to post the 10-lines script that reproduces your problem, so we can see it. If you haven't reduced your problematic script to 10 lines by now, this is the time to start doing so.

      Please also show a 10-line HTML file which you use to send the POST upload to your test script.

        I've added the code at http://www.perlmonks.org/?node_id=910534