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


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to