1936
HFS ~ HTTP File Server / Re: upload filter
« on: November 07, 2007, 10:54:03 PM »
filter for upload is by default \HFS.* all files begining by hfs. are not allowed,
changing this default by * will enable overwrite files like hfs.diff.tpl in a sub folder
changing this default by * will enable overwrite files like hfs.diff.tpl in a sub folder
Quote
function complyUploadFilter():boolean;
var
s: string;
begin
if f.isTemp() then s:=f.parent.uploadFilterMask
else s:=f.uploadFilterMask;
if s = '' then s:='\hfs.*'; // the user can disable this default filter by inputing * as mask
result:=fileMatch(s, optAnsi(tpl.utf8, conn.post.filename));
if result then exit;
data.uploadFailed:='File name or extension forbidden';
end; // complyUploadFilter