I checked the permissions and it has all the necessary permissions.
Here is an example of the code, I'm probably way off first time trying to do something like this:
$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);
}
|