Python CGI Issues
Question: I am building a simple web app (posted part of it yesterday) but I am
struggling with a portion:

1) Request a text file to upload 2) Save the uploaded file to a directory

I am using python and cgi for this. cgi is working as confirmed with a simple
test.cgi file.

Here is my current code for request_input.cgi:

    
    
        #!/usr/bin/python
        import cgi
        print "Content-type: text/html\r\n\r\n"
        print '<html>'
        print '<body>'
        print '<form enctype="multipart/form-data" action="save_input.cgi" method="post">'
        print '<p>File: <input type="file" name="filename" /></p>'
        print '<p>input type="submit" value="Upload" /></p>'
        print '</form>'
        print '</body>'
        print '</html>'
    

Now when I tail the apache error log I get the following errors: "(2)No such
file or directory: exec of '/var/www/ipcheck/request_input.cgi' failed,
referer: [http://192.168.3.77/ipcheck/?C=M;O=A]" "Premature end of script
headers: request_input.cgi, referer [http://192.168.3.77/ipcheck/?C=M;O=A]"

Any help would be awesome! Thanks a lot


Answer: dos2unix resolved issue. Built in windows, moved to linux. Thanks for the
help.

