diff options
author | michael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2013-07-15 07:39:20 +0000 |
---|---|---|
committer | michael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2013-07-15 07:39:20 +0000 |
commit | 9a797061fcd6b993ac0372edfa3a4e2678fd7bf2 (patch) | |
tree | 593b59a368fb89e7c100e5b91b1565a74ac3ea00 /packages/fcl-web | |
parent | 2987f11572c110fe54b4395772c530d7c62d270c (diff) | |
download | fpc-9a797061fcd6b993ac0372edfa3a4e2678fd7bf2.tar.gz |
* Fix DeleteTempUploadedFile so it frees the stream
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@25101 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/fcl-web')
-rw-r--r-- | packages/fcl-web/src/base/httpdefs.pp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/fcl-web/src/base/httpdefs.pp b/packages/fcl-web/src/base/httpdefs.pp index a40c153573..b0ebe45cb5 100644 --- a/packages/fcl-web/src/base/httpdefs.pp +++ b/packages/fcl-web/src/base/httpdefs.pp @@ -150,6 +150,7 @@ type FSize: Int64; FStream : TStream; Protected + // Note that this will free the file stream, to be able to close it - file is share deny write locked! Procedure DeleteTempUploadedFile; virtual; function GetStream: TStream; virtual; Public @@ -351,6 +352,7 @@ type procedure ProcessURLEncoded(Stream : TStream;SL:TStrings); virtual; Function RequestUploadDir : String; virtual; Function GetTempUploadFileName(Const AName, AFileName : String; ASize : Int64) : String; virtual; + // This will free any TUPloadedFile.Streams that may exist, as they may lock the files and thus prevent them Procedure DeleteTempUploadedFiles; virtual; Procedure InitRequestVars; virtual; Procedure InitPostVars; virtual; @@ -1705,6 +1707,8 @@ Var s: String; begin + if Assigned(FStream) and (FStream is TFileStream) then + FreeAndNil(FStream); if (LocalFileName<>'') and FileExists(LocalFileName) then DeleteFile(LocalFileName); end; |