Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Feb : Re: idftp server with large files
| Subject: | Re: idftp server with large files |
| Posted by: | "API" (ari.pikivir..@kolumbus.fi) |
| Date: | Tue, 27 Feb 2007 00:48:21 |
at that part of code, even it's not threadsafe, you should remove "try" at
least.
"Frankie" <frankjohnsson2000@yahoo.se> wrote in message
news:45e36267$1@newsgroups.borland.com...
> Can i see how you do it? Iīm a Indy newbee and just by looking through a
> demo i wrote this code:
>
> procedure TfrmMain.ftpServerRetrieveFile(ASender: TIdFTPServerThread;
> const AFileName: String; var VStream: TStream);
> begin
> try
> VStream := TFileStream.Create(AppDir+'\'+AFilename,fmOpenRead);
> end;
>
> Thatīs it...now i expect the file to be dowloaded to the client...but it
> doesnīt.
>
> The file is 350 Mb. I got a hint from Remy that AppDir isnīt
> threadsafe...so now it is a global variabel...maybe i should use Indys
> Threadsafestring?
>
> The AppDir contains the path 'C:\test' Maybe it has something to do with
> the AFileName...it contains a 'V' and then the filename?
>
> What am i doing wrong?
>
> Hope you have time to answer this.
>
> Thanx in advance
> Frankie
>
> API skrev:
>> "Frankie" <frankjohnsson2000@yahoo.se> wrote in message
>> news:45e35597$1@newsgroups.borland.com...
>>> You have any problems with smaller sizes like 1 Gb or in my case 350 Mb
>>> files?
>>> /Frankie
>>
>> Thanks for the link to that large file discussion.
>>
>> No problems with "small" files below that stream limit.
>>
>> I think problems you're facing has something to do with either bad client
>> or unsynchronized threads (client threads).
>>
>> /Ari