At 09:23 PM 3/11/02 +0000, Mariusz K wrote: >Thank you very much for your response. Could you recommend any solution? I >know the path where the file is sitting and I want to create a script that >would automatically upload it. (I don't want the user to be bothered with >entering the path each time.)
Don't know if you can automatically upload the file... sounds like a security risk. But you can pre-populate the form element that they click with something, I would think... try setting the VALUE attribute of the INPUT field. >Thank you, > >ps. You said: "you want to take this to the beginners cgi list"; isn't >this the beginner's mailing-list? ([EMAIL PROTECTED]) Correct. But there is another list that focusses on CGI issues like this one: [EMAIL PROTECTED] >>Subject: Re: uploading files >>Date: Mon, 11 Mar 2002 09:17:24 -0800 >> >>At 12:36 AM 3/11/02 -0600, Mariusz wrote: >>>Hi, >>> >>>I wrote this simple script to upload files, but when I substitute >>>param('uploadfile') with the actual path in double quotes it doesn't work >>>that way. However, it works perfectly fine if I use the form to submit the >>>path of the file through an html form (the way it is below). Can anyone >>>help? >> >>You want to take this to the beginners-cgi list. >> >>The value returned from param() for a file upload is magical and evaluates >>as the name of the file in a string context and a filehandle to the file >>contents in IO context. You can't just replace it with a string. >> >>>my $file = param('uploadfile'); >>> >>>open(UPLOAD, ">../employees/schedule.html") || Error(); >>>my ($data,$length,$chunk); >>>while ($chunk = read ($file, $data, 1024)){ >>> print UPLOAD $data; >>>} >>>close(UPLOAD); >>> >>> >>>Thanks, >>>Mariusz >> >>-- >>Peter Scott >>Pacific Systems Design Technologies >>http://www.perldebugged.com > > > > >_________________________________________________________________ >Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. > > >-- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]