in reply to Re: Problems deleting a file.
in thread Problems deleting a file.
$filekey = $cgi->param("doc_file"); unlink($filekey) if -e $pubFile_path$filekey; if ($filekey) { if ($filekey =~ /([^\/\\]+)$/) { $filename = $1; ($ext) = $filename =~ /(\.\w+)$/; } else { return "You attempted to upload <B>$filekey</B> that isn't properly fo +rmatted. Please rename the file on your computer, and attempt to uplo +ad it again. Files may not have forward or backward slashes in their +names. Also, they may not be prefixed with one (or more) periods."; } $path = $pubFile_path . "/" . $count . $ext; open(OUTFILE, ">$path") or &script_err("Unable to open $path \nReason +: $!");; binmode(OUTFILE); while ($bytes = read($filekey,$buffer,1024)) { $totalbytes += $bytes; print OUTFILE $buffer; } close(OUTFILE); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Problems deleting a file.
by tachyon (Chancellor) on Oct 16, 2002 at 22:56 UTC |