* Take care of locking when reading a file.

git-svn-id: trunk@22447 -
This commit is contained in:
michael 2012-09-24 09:00:52 +00:00
parent 944c1172ee
commit cd733daaa4
3 changed files with 3 additions and 3 deletions

View File

@ -935,7 +935,7 @@ begin
SS:=TStringStream.Create(s);
try
SS.Seek(0,soFromEnd);
F:=TFileStream.Create(AFileName,fmOpenRead);
F:=TFileStream.Create(AFileName,fmOpenRead or fmShareDenyWrite);
try
SS.CopyFrom(F,F.Size);
finally

View File

@ -129,7 +129,7 @@ begin
AResponse.ContentType:=MimeTypes.GetMimeType(ExtractFileExt(AFileName));
If (AResponse.ContentType='') then
AResponse.ContentType:='Application/octet-stream';
F:=TFileStream.Create(AFileName,fmOpenRead);
F:=TFileStream.Create(AFileName,fmOpenRead or fmShareDenyWrite);
try
AResponse.ContentLength:=F.Size;
AResponse.ContentStream:=F;

View File

@ -1469,7 +1469,7 @@ begin
begin
If (FLocalFileName='') then
Raise HTTPError.Create(SErrInternalUploadedFileError);
FStream:=TFileStream.Create(FLocalFileName,fmOpenRead);
FStream:=TFileStream.Create(FLocalFileName,fmOpenRead or fmShareDenyWrite);
end;
Result:=FStream;
end;