
MaDD
stranger
Mar 23, 2001, 12:48 AM
Post #1 of 1
(476 views)
|
Temp files with upload script
|
Can't Post
|
|
Sorry for the cross post but i'm hoping on more success here then in the Intermediate section I've written (and borrowed) the following code into my script to allow users to upload images. It works fine but i keep getting a pile of temporary files in the root-dir. They look like this: 'CGItemp19549' and are a plain copy of the uploaded file. (when i add the right extention it's the uploaded image) Is there a way to prevent this or do I have to write some code to remove these files automaticly ? Here are the important bits of the code i use: =================================== use CGI qw/:standard/; $limit= 20; $CGI::POST_MAX=1024 * $limit; =================================== open(OUTFILE, ">$dir$file")||&error("Can't open $dir$file. $!"); binmode OUTFILE; # binmode is for windows only. Ignored by unix while ($bytesread=read($filename,$buffer,1024)) {print OUTFILE $buffer; } close (OUTFILE); =================================== Not a big problem...just annoying. Huub. Who is this General Failure and what is he doing on my hard-drive ?
|