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

As I have mentioned in my post, I'm using the tutorial given at http://www.sitepoint.com/uploading-files-cgi-perl-2/ for the Perl script. So I guess I'm using the CGI.pm module

"But whichever module you use, you may find it necessary to explicitly allow uploads"

Not sure about how to do that, but there is nothing said about that in the tutorial

When I use the POST method, its giving an error " the requested method POST is not allowed for the url .."

Replies are listed 'Best First'.
Re^3: Perl CGI File Upload Problem
by davido (Cardinal) on Jun 19, 2011 at 19:32 UTC

    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

      "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.