Browse Source

Patch from Atilla Borka: (bug 13280
* Fixed TRequest.files.Size property
* Only non zero length files or files with non empty names will be considered

git-svn-id: trunk@12881 -

joost 16 years ago
parent
commit
239538dccf
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/fcl-web/src/httpdefs.pp

+ 3 - 1
packages/fcl-web/src/httpdefs.pp

@@ -1248,6 +1248,7 @@ begin
           FF:='' //No tmp file will be created for empty files
         else
           begin
+          FI.DLen:=J;
           FF:=GetTempUploadFileName;
           F:=TFileStream.Create(FF,fmCreate);
           Try
@@ -1256,7 +1257,8 @@ begin
             F.Free;
           end;
           end;
-        With Files.Add as TUploadedFile do
+        if (Value <> '') or (FI.DLen > 0)then{only non zero length files or files with non empty names will be considered}
+         With Files.Add as TUploadedFile do
           begin
           FieldName:=FI.Name;
           FileName:=FI.FileName;