> Thanks Timothy. However, I'm not sure if I understand... > constraining to html? I said I wanted to avoid html and the > need to supply the path of the file via form. Below is my > short script; all I want to do is to be able to specify the > path of the file within the script, instead of waiting for > the input from the form. > > #!/usr/bin/perl -W > > use DBI; > use CGI ':standard'; > > print "Content-type:text/html\n\n"; > my $file = param('uploadfile'); #(my $file = > "C:\folder\filename.html"; - doesn't work ) > > open(UPLOAD, ">../employees/schedule.html") || Error(); > my ($data,$length,$chunk); > while ($chunk = read ($file, $data, 1024)){ > print UPLOAD $data; > } > close(UPLOAD); > > sub Error { print "Couldn't open temporary file: $!"; exit;}
Unfortunately, that method will not work, because all you're passing to your script is the filename of what you want to upload... The easiest solution will be to use an html form to upload the file, I'm afraid. The problem is when you try to open c:\folder\filename.html on the server, where it doesn't exist. Hope that helps, -dave -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]