Thread View: borland.public.cppbuilder.internet.socket
4 messages
4 total messages
Started by Jonny
Tue, 10 May 2005 08:13
Indy ftp server
Author: Jonny
Date: Tue, 10 May 2005 08:13
Date: Tue, 10 May 2005 08:13
11 lines
1217 bytes
1217 bytes
Hi, I'am using Indy to build a customized ftp server.
Having syntax problem with the code:
void __fastcall TfrmMAIN::IdFTPServerStoreFile TIdFTPServerThread *ASender,
const AnsiString AFileName, bool AAppend, TStream *&VStream)
{
LogMessage(Owner, "ServerStoreFile" , true, true);
}
What should it look like to handle upload request ie. put from a ftp client?
Regards,
Jonny
Re: Indy ftp server
Author: Remy Lebeau (TeamB)
Date: Tue, 10 May 2005 16:46
Date: Tue, 10 May 2005 16:46
32 lines
1905 bytes
1905 bytes
"Jonny" <jonny.heyman@cekab.se> wrote in message
news:42806d24$1@newsgroups.borland.com...
> Having syntax problem with the code:
What EXACTLY are you having a problem with? Please be more specific.
> What should it look like to handle upload request ie. put from a ftp
client?
You are supposed to be creating a suitable TStream object, such as a
TFileStream, to handle the file storage. For example:
void __fastcall TfrmMAIN::IdFTPServerStoreFile(TIdFTPServerThread
*ASender, const AnsiString AFileName, bool AAppend, TStream *&VStream)
{
// translate AFileName from an FTP-relative path
// into a local HD path as needed, then...
AnsiString LocalFileName = "...";
Word Flags;
if( (AAppend) && FileExists(LocalFileName) )
Flags = (fmOpenReadWrite | fmShareDenyWrite);
else
Flags = fmCreate;
VStream = new TFileStream(LocalFileName, Flags);
}
Gambit
Re: Indy ftp server
Author: Jonny
Date: Wed, 11 May 2005 17:39
Date: Wed, 11 May 2005 17:39
39 lines
1969 bytes
1969 bytes
Thank's I'll try this and get back ?
Jonny
"Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> wrote:
>
>"Jonny" <jonny.heyman@cekab.se> wrote in message
>news:42806d24$1@newsgroups.borland.com...
>
>> Having syntax problem with the code:
>
>What EXACTLY are you having a problem with? Please be more specific.
>
>> What should it look like to handle upload request ie. put from a ftp
>client?
>
>You are supposed to be creating a suitable TStream object, such as a
>TFileStream, to handle the file storage. For example:
>
> void __fastcall TfrmMAIN::IdFTPServerStoreFile(TIdFTPServerThread
>*ASender, const AnsiString AFileName, bool AAppend, TStream *&VStream)
> {
> // translate AFileName from an FTP-relative path
> // into a local HD path as needed, then...
> AnsiString LocalFileName = "...";
>
> Word Flags;
> if( (AAppend) && FileExists(LocalFileName) )
> Flags = (fmOpenReadWrite | fmShareDenyWrite);
> else
> Flags = fmCreate;
>
> VStream = new TFileStream(LocalFileName, Flags);
> }
>
>
>Gambit
>
>
Re: Indy ftp server
Author: Jonny
Date: Wed, 11 May 2005 18:20
Date: Wed, 11 May 2005 18:20
46 lines
2139 bytes
2139 bytes
The code worked fine!
Again: thank's.
Jonny
"Jonny" <jonny.heyman@cekab.se> wrote:
>
>Thank's I'll try this and get back ?
>Jonny
>
>"Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> wrote:
>>
>>"Jonny" <jonny.heyman@cekab.se> wrote in message
>>news:42806d24$1@newsgroups.borland.com...
>>
>>> Having syntax problem with the code:
>>
>>What EXACTLY are you having a problem with? Please be more specific.
>>
>>> What should it look like to handle upload request ie. put from a ftp
>>client?
>>
>>You are supposed to be creating a suitable TStream object, such as a
>>TFileStream, to handle the file storage. For example:
>>
>> void __fastcall TfrmMAIN::IdFTPServerStoreFile(TIdFTPServerThread
>>*ASender, const AnsiString AFileName, bool AAppend, TStream *&VStream)
>> {
>> // translate AFileName from an FTP-relative path
>> // into a local HD path as needed, then...
>> AnsiString LocalFileName = "...";
>>
>> Word Flags;
>> if( (AAppend) && FileExists(LocalFileName) )
>> Flags = (fmOpenReadWrite | fmShareDenyWrite);
>> else
>> Flags = fmCreate;
>>
>> VStream = new TFileStream(LocalFileName, Flags);
>> }
>>
>>
>>Gambit
>>
>>
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads