mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 14:19:31 +02:00
* Reworked TUploadedFile.Stream
git-svn-id: trunk@26572 -
This commit is contained in:
parent
be85998313
commit
e164a16171
@ -153,6 +153,7 @@ type
|
||||
// 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;
|
||||
Procedure FreeStream; virtual;
|
||||
Public
|
||||
Destructor Destroy; override;
|
||||
Property FieldName : String Read FFieldName Write FFieldName;
|
||||
@ -1727,13 +1728,15 @@ Var
|
||||
s: String;
|
||||
|
||||
begin
|
||||
if Assigned(FStream) and (FStream is TFileStream) then
|
||||
FreeAndNil(FStream);
|
||||
if (FStream is TFileStream) then
|
||||
FreeStream;
|
||||
if (LocalFileName<>'') and FileExists(LocalFileName) then
|
||||
DeleteFile(LocalFileName);
|
||||
end;
|
||||
|
||||
|
||||
function TUploadedFile.GetStream: TStream;
|
||||
|
||||
begin
|
||||
If (FStream=Nil) then
|
||||
begin
|
||||
@ -1744,9 +1747,15 @@ begin
|
||||
Result:=FStream;
|
||||
end;
|
||||
|
||||
destructor TUploadedFile.Destroy;
|
||||
Procedure TUploadedFile.FreeStream;
|
||||
|
||||
begin
|
||||
FreeAndNil(FStream);
|
||||
end;
|
||||
|
||||
destructor TUploadedFile.Destroy;
|
||||
begin
|
||||
FreeStream;
|
||||
Inherited;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user