回覆: Re: [twsocket] HTTP POST - SendStream With TMemoryStream

2006-01-19 Thread Opqrst Ghrst
thanks F.P.

I See,
but if the file is more than 1 GB, That will cost my
too mush disk free space,I am confuse on this problem,
because I must add Form Field Value information on the
Head of the data and boundary end of data.it will be
work by ContentTypePost="multipart/form-data" mothod
post. 

--- Francois PIETTE <[EMAIL PROTECTED]> 說:

> > when I use Http Post Web to send file,
> > if the file is bigger as 100mb.
> > because content must has some FormField to post,
> > I use MemorrStream write these information and
> > FileStream.
> > when I load to TMemoryStream it will cause my
> computer
> > slow to build MemoryStream, can I use other
> mothods to
> > resolve this problem?
> 
> If you use TMemoryStream, then your 100MB of data is
> loaded onto RAM which 
> can be slow. Use another kind of TStream, for
> example a TFileStream which 
> store his data in a disk file instead of RAM.
> 
> --
> Contribute to the SSL Effort. Visit
> http://www.overbyte.be/eng/ssl.html
> --
> [EMAIL PROTECTED]
> http://www.overbyte.be
> 
> 
> > -- 
> To unsubscribe or change your settings for TWSocket
> mailing list
> please goto
> http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be


___
 YM - 離線訊息
 就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說話都冇走失。
 http://messenger.yahoo.com.hk
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

回覆: Re: 回覆: Re: [twsocket] HTTP POST - SendStream With TMemoryStream

2006-01-19 Thread Opqrst Ghrst

I see,
but HttpCli.SendStrem must Write "Buf1" String before
Load FileStream, and Wirte "Buf2" String at end.
it seems will change my oringe file imformation.
Because the ContentTypePost="multipart/form-data"
I cannot only read file to Stream.
Do You have nice ideal?
Thanks.


Buf1="-7d5168231620eb2Content-Disposition:
form-data; name="fname+";
filename="+key+"\r\nContent-Type:
application/octet-stream\r\n\r\n";

Buf2=="-7d5168231620eb2--"



--- Paul <[EMAIL PROTECTED]> 說:

> You don't need any buffers to create yourself.
> 
> just use
> HttpCli.SendStrem:= TFileStream.Create('your
> file', fmOpenRead)
> HttpCli.SendStream.Position:= 0;
> HttCli.PostAsync;
> 
> Paul
> 
> 
> - Original Message - 
> From: "Opqrst Ghrst" <[EMAIL PROTECTED]>
> To: "ICS support mailing" 
> Sent: Thursday, January 19, 2006 5:00 PM
> Subject: 回覆: Re: [twsocket] HTTP POST -
> SendStream With TMemoryStream
> 
> 
> > hello
> >
> > I try to use FileStrem, it must has Free Space to
> > create the same size of File,but it should be
> better
> > than TmemoryStream, if teh file is biger.
> >
> > HttpCli->ContentTypePost="multipart/form-data;
> >
>
boundary=---7d5168231620eb2";
> >
>
Buf1="-7d5168231620eb2\r\nContent-Disposition:
> > form-data; name="fname+";
> > filename="+key+"\r\nContent-Type:
> > application/octet-stream\r\n\r\n";
> >
>
Buf2=="-7d5168231620eb2--"
> >
> > SendStream=new TFileStream("temp", fmCreate);
> > SendStream->Size=0;
> > SendStream->WriteBuffer(Buf1.c_str(),
> Buf1.Length());
> >TFileStream* ms=new
> > TFileStream(Filepath.c_str(), fmOpenRead);
> > SendStream->CopyFrom(ms,ms->Size);
> > delete ms;
> > SendStream->WriteBuffer(Buf2.c_str(),
> Buf2.Length());
> > SendStream->Seek(0, soFromBeginning);
> >
> >
> >
> > --- Paul <[EMAIL PROTECTED]> 說:
> >
> >> You should use a TFileStream instead of a
> >> TMemorystream.
> >>
> >> Paul
> >>
> >>
> >>
> >> - Original Message - 
> >> From: "Opqrst Ghrst" <[EMAIL PROTECTED]>
> >> To: "ICS support mailing" 
> >> Sent: Thursday, January 19, 2006 10:37 AM
> >> Subject: [twsocket] HTTP POST - SendStream With
> >> TMemoryStream
> >>
> >>
> >> >
> >> > Hello all,
> >> >
> >> > when I use Http Post Web to send file,
> >> > if the file is bigger as 100mb.
> >> > because content must has some FormField to
> post,
> >> > I use MemorrStream write these information and
> >> > FileStream.
> >> > when I load to TMemoryStream it will cause my
> >> computer
> >> > slow to build MemoryStream, can I use other
> >> mothods to
> >> > resolve this problem?
> >> >
> >> >
> >> > ___
> >> > YM - 離線訊息
> >> >
> >>
> >
>
就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說話都冇走失。
> >> > http://messenger.yahoo.com.hk
> >> >
> >>
> >>
> >>
> >
>

> >>
> >>
> >> > -- 
> >> > To unsubscribe or change your settings for
> >> TWSocket mailing list
> >> > please goto
> >> http://www.elists.org/mailman/listinfo/twsocket
> >> > Visit our website at http://www.overbyte.be
> >>
> >> > -- 
> >> To unsubscribe or change your settings for
> TWSocket
> >> mailing list
> >> please goto
> >> http://www.elists.org/mailman/listinfo/twsocket
> >> Visit our website at http://www.overbyte.be
> >
> >
> > ___
> > YM - 離線訊息
> >
>
就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說話都冇走失。
> > http://messenger.yahoo.com.hk
> >
> 
> 
>

> 
> 
> > -- 
> > To unsubscribe or change your settings for
> TWSocket mailing list
> > please goto
> http://www.elists.org/mailman/listinfo/twsocket
> > Visit our website at http://www.overbyte.be 
> 
> > -- 
> To unsubscribe or change your settings for TWSocket
> mailing list
> please goto
> http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be


___
 YM - 離線訊息
 就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說話都冇走失。
 http://messenger.yahoo.com.hk
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

回覆: Re: [twsocket] HTTP POST - SendStream With TMemoryStream

2006-01-19 Thread Opqrst Ghrst
hello

I try to use FileStrem, it must has Free Space to
create the same size of File,but it should be better
than TmemoryStream, if teh file is biger.

HttpCli->ContentTypePost="multipart/form-data;
boundary=---7d5168231620eb2";
Buf1="-7d5168231620eb2\r\nContent-Disposition:
form-data; name="fname+";
filename="+key+"\r\nContent-Type:
application/octet-stream\r\n\r\n";
Buf2=="-7d5168231620eb2--"

SendStream=new TFileStream("temp", fmCreate);
SendStream->Size=0;
SendStream->WriteBuffer(Buf1.c_str(), Buf1.Length());
TFileStream* ms=new
TFileStream(Filepath.c_str(), fmOpenRead);
SendStream->CopyFrom(ms,ms->Size);
delete ms;
SendStream->WriteBuffer(Buf2.c_str(), Buf2.Length());
SendStream->Seek(0, soFromBeginning);



--- Paul <[EMAIL PROTECTED]> 說:

> You should use a TFileStream instead of a
> TMemorystream.
> 
> Paul
> 
> 
> 
> - Original Message - 
> From: "Opqrst Ghrst" <[EMAIL PROTECTED]>
> To: "ICS support mailing" 
> Sent: Thursday, January 19, 2006 10:37 AM
> Subject: [twsocket] HTTP POST - SendStream With
> TMemoryStream
> 
> 
> >
> > Hello all,
> >
> > when I use Http Post Web to send file,
> > if the file is bigger as 100mb.
> > because content must has some FormField to post,
> > I use MemorrStream write these information and
> > FileStream.
> > when I load to TMemoryStream it will cause my
> computer
> > slow to build MemoryStream, can I use other
> mothods to
> > resolve this problem?
> >
> >
> > ___
> > YM - 離線訊息
> >
>
就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說話都冇走失。
> > http://messenger.yahoo.com.hk
> >
> 
> 
>

> 
> 
> > -- 
> > To unsubscribe or change your settings for
> TWSocket mailing list
> > please goto
> http://www.elists.org/mailman/listinfo/twsocket
> > Visit our website at http://www.overbyte.be 
> 
> > -- 
> To unsubscribe or change your settings for TWSocket
> mailing list
> please goto
> http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be


___
 YM - 離線訊息
 就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說話都冇走失。
 http://messenger.yahoo.com.hk
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be