|
Post by tomazaz on Feb 1, 2006 12:51:30 GMT -5
Several days ago we have found strange bug in our ISAPI development project where we are using TVCLZip pro trial version.
So we are hosting ISAPI on IIS 6.0(win2003), sometimes when two users from different location at the same time upload file for zipping, the first uploaded file appears in second file archive.
Let say #1 user upload file using ISAPI to #A dir, zipping executed. At the same time #2 user upload file to #B, zipping executed. At the end zip archive does not appears in #A, instead two files are zipped in #B dir.
We don't understand is it some kind om memory sharing problem in TVCLZip or it is in ISAPI multithreading.
Any suggestion or thoughts are welcome!
Our code is:
{..uploadinf files code skipped}
VCLZip.FilesList.Clear;
for cik := 0 to AList.Count - 1 do begin
AProcFile := ProcessingUploadedFiles(AList[cik]);
VCLZip.FilesList.Add(AProcFile);
end;
if VCLZip.FilesList.Count <> 0 then begin VCLZip.ZipName := AJobPath + ChangeFileExt(AUploadFileName, '.zip'); VCLZip.TempPath := AJobPath; VCLZip.Zip; result := ExtractFileName(VCLZip.ZipName); end
|
|
|
Post by Kevin on Feb 1, 2006 22:17:14 GMT -5
I see nothing in your code that looks incorrect. Without knowing more about how your application is structured I don't really have an answer for you.
It shouldn't really matter, but just for my own curiosity, are you working with VCLZip Lite or VCLZip Pro? And what version of Delphi/BCB are you using?
Kevin
|
|
|
Post by tomazaz on Feb 2, 2006 6:39:41 GMT -5
There is nothing more to write, I have pasted all code, except upload code, but I am sure bug is in posted code. I will try to create TVCLZip dynamically in RunTime like
with TVclZip.Create(self) do try finally free end
and let you know about result.
I am using Delphi7, and VCLZip pro trial which was downloaded from your site one month ago.
|
|
|
Post by Kevin on Feb 2, 2006 7:36:00 GMT -5
1) Is each zip operation being performed by a separate instance of VCLZip? Just wanted to be sure you are not trying to perform two operations at the same time by the same instance of VCLZip.
2) Are you ending up with 2 zip archives each with one file in it or one zip archive with two files in it?
Kevin
|
|
|
Post by tomazaz on Feb 2, 2006 10:43:53 GMT -5
1. Good question, I use your VCL in ISAPI, as I understand IIS run separated instances of ISAPI for every server request. It should be so. I don't have problems with uploading, the files is not mixed or damaged.
2. I get one ZIP archive with two files in it. The second file in archyve is taken from another upload and somehow appears in zip.
|
|
|
Post by Kevin on Feb 2, 2006 12:33:27 GMT -5
Well, if for some reason aJobPath somehow ends up the same for each process, the second upload would add its file to the existing zip file if the zip file name is the same.
Have you debugged to be sure aJobPath is different and correct for each process?
|
|
|
Post by tomazaz on Feb 3, 2006 6:08:34 GMT -5
aJobPath is unique for every process, it is pointed to ZipFile path. I will try to play with this more and let you know about result.
|
|
|
Post by tomazaz on Mar 3, 2006 5:32:22 GMT -5
I have found where was error, I have declarated variables as Global and not under DataModule, so variables was shared beetween ISAPI instances. So my problem solved and TVCLZip works perfect.
|
|
|
Post by Kevin on Mar 3, 2006 7:38:02 GMT -5
Thank you for following up on that. I appreciate it. Kevin
|
|