in reply to Re: Re: using die
in thread using die in CGI context / 500 errors

If the script is on a *NIX box (which given the #! line I can see it is) and you want to access local files you will need to set up some networking calls to access them. A better (and safer answer) would be to upload your files to a folder on your server and access them from there.

John

Replies are listed 'Best First'.
Re: Re: Re: Re: using die
by Baz (Friar) on May 10, 2002 at 13:40 UTC
    I see, so under what circumstances would the code I have written above work - I presumed it would let a client upload files to a server, but I also felt it looked much too easy - this is my first time doing any file uploading!. I wrote this code because I want to allow people to upload files to my server - these files will eventually be organised using MySql. WHat modifications will I need to make - security is a big issue too - is it possible to give someone enough access in order for them to upload a file without compromising server security - im sure it is. Anyway Thanks, Barry.
    This is the html I'm using to call the script -
    <HTML><BODY> <FORM ENCTYPE="multipart/form-data" ACTION="http://baz.perlmonk.org/co +okie.cgi" METHOD="POST"> Please choose directory to upload to:<br> <SELECT NAME="dir"> <OPTION VALUE="images">images</OPTION> <OPTION VALUE="sounds">sounds</OPTION> </SELECT> <p> Please select a file to upload: <BR> <INPUT TYPE="FILE" NAME="file"> <p> <INPUT TYPE="submit"> </FORM> </HTML></BODY>
(shockme) Re: Re: Re: Re: using die
by shockme (Chaplain) on May 10, 2002 at 20:52 UTC
    Quite off topic, but #! is not indicative of *nix. It's a nicety on a *nix box, but will not interfere with execution on other operating systems. (If it's not present in a *nix environment, the script can still be executed with perl script.pl.)

    If things get any worse, I'll have to ask you to stop helping me.