Hi all,

I tried the following script and it download the file I want
in the /cgi-bin directory.
The downloaded files have a name like CGItemp56530.
I don't  know what is the problem with this file, but I can't rename or
delete it without closing the web server.
Do you know what could I do to download the file with its real name.
And I want to be able to delete it, of course.

But the main problem is that I can't choose another folder to download. It
goes only to /cgi-bin.

Could be a problem the fact that I am using Windows 2k?

Thank you very much, I checked the perldoc CGI, but I couldn't find helpfull
information there.
It tells me that I need to read the Camel book to understand more, but I
don't have this book.

Here is the script:

#!c:\perl\bin\perl.exe -w

use CGI;

$query = new CGI;

print $query->header;
print $query->start_html("File Upload");
print "<h1>File Upload</h1>";
print $query->start_multipart_form;
print $query->filefield(-name=>'uploaded_file',
                        -default=>'starting value',
                        -size=>50,
                        -maxlength=>80);
print $query->submit(   -name=>'submit',
                        -value=>'submit');
print $query->defaults('Reset');
print $query->endform;

if ($filename = $query->param('uploaded_file')) {
print ($filename);
binmode($filename);
open (OUTFILE,">>c:\\Program Files\\Apache Group\\Apache\\logs");
binmode(OUTFILE);
while ($bytesread=read($filename,$buffer,1024)) {
   print OUTFILE $buffer;
        }
       close $filename;

}
else {
print "Don't leave the fields blank!";
}
Teddy,
My dear email address is [EMAIL PROTECTED]



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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

Reply via email to