big file transfer
19 answers - 382 bytes -

hello everyone.
i have a general question about filetransfer.
i want to transfer large files >4gb.
i just need a upload and i need authetification and a crc-check would be
nice.
ftp looks like the right protocol. but i have a lot of trouble with this
large files on ftp.
is there a other protocol that can do this ?
thanks for any idea.
roland
No.1 | | 958 bytes |
| 
Roland Frei wrote:
hello everyone.
i have a general question about filetransfer.
i want to transfer large files >4gb.
i just need a upload and i need authetification and a crc-check would be
nice.
ftp looks like the right protocol. but i have a lot of trouble with this
large files on ftp.
is there a other protocol that can do this ?
I think FTP is the right protocol, however ICS does support such
big files without changes.
Here is an example:
function TCustomWSocket.Receive(Buffer : Pointer; BufferSize: integer) : integer;
begin
Result := DoRecv(Buffer^, BufferSize, 0);
if Result < 0 then
FLastError :=
else
{ Here we should check for overflows ! It is well possible to }
{ receive more than 2GB during a single session. }
{ we could use an Int64 variable }
FReadCount := FReadCount + Result;
end;
Arno Garrels
thanks for any idea.
roland
No.2 | | 1239 bytes |
| 
Arno Garrels wrote:
I think FTP is the right protocol, however ICS does support such
big files without changes.
, does _not_ support such big files without changes.
Roland Frei wrote:
>hello everyone.
>i have a general question about filetransfer.
>i want to transfer large files >4gb.
>i just need a upload and i need authetification and a crc-check would be
>nice.
>
>ftp looks like the right protocol. but i have a lot of trouble with this
>large files on ftp.
>is there a other protocol that can do this ?
I think FTP is the right protocol, however ICS does support such
big files without changes.
Here is an example:
function TCustomWSocket.Receive(Buffer : Pointer; BufferSize: integer) :
integer; begin
Result := DoRecv(Buffer^, BufferSize, 0);
if Result < 0 then
FLastError :=
else
{ Here we should check for overflows ! It is well possible to }
{ receive more than 2GB during a single session. }
{ we could use an Int64 variable }
FReadCount := FReadCount + Result;
end;
Arno Garrels
>
>thanks for any idea.
>roland
No.3 | | 463 bytes |
| 
i have a general question about filetransfer.
i want to transfer large files >4gb.
i just need a upload and i need authetification and a crc-check would be
nice.
ftp looks like the right protocol. but i have a lot of trouble with this
large files on ftp.
is there a other protocol that can do this ?
Can you elaborate about what the application has to do ?
What are the requirements ?
Are you writing both client and server ?
No.4 | | 863 bytes |
| 
>i have a general question about filetransfer.
>i want to transfer large files >4gb.
>i just need a upload and i need authetification and a crc-check would be
>nice.
>>
>ftp looks like the right protocol. but i have a lot of trouble with this
>large files on ftp.
>is there a other protocol that can do this ?
>
Can you elaborate about what the application has to do ?
backup a file server.
What are the requirements ?
- large file support. (int64)
- single port use (because on ftp, the control connection crashes sometimes
after a couple of houres (noop problem))
- pure delphi (vcl)
- authentification.
- crc checking would be nice
- bandwith control would be nice
Are you writing both client and server ?
yes.
No.5 | | 1110 bytes |
| 
Can you elaborate about what the application has to do ?
backup a file server.
What are the requirements ?
- large file support. (int64)
- single port use (because on ftp, the control connection crashes sometimes
after a couple of houres (noop problem))
- pure delphi (vcl)
- authentification.
- crc checking would be nice
- bandwith control would be nice
Are you writing both client and server ?
yes.
K. I think you are in a case it is worth developping your own custom protocol between your client
and your server.
- crc checking would be nice
This is not required since TCP is a reliable transport protocol.
- large file support. (int64)
No problem. Even without changing FReadCount (see Arno's message), except of course if you want to
use this property that would warp aroung 2GB. Anyway changing it to Int64 is quick and easy.
- authentification.
Easy. Better to implement a system where password never pass into clear text. Easy to send MD5 or
SHA1 hash instead of the password. We can talk more if you need it.
No.6 | | 624 bytes |
| 
I am making a small server to display a page of images. In the getdocument
method, I call a procedure passing all of the flags to my procedure
"ShowThumb(Sender, Client, Flags)". What is happening is that the images
are being displayed on the page, but they are coming out as garbage
characters, randomly truncated images, etc.
The images stored on disk are good. I believe I am running into some kind
of threading issue. I read the images off disk, scale them, save the to a
stream and pass them to HttpConnection.DocStream to complete the page.
Any assistance is greatly appreciated. Thanks
No.7 | | 277 bytes |
| 
First make this work single threaded, starting with ICS sample program WebServ.
Your image URL must match a dynamic URL intercepted by the server so that processing can be done.
Multithreading is probably not needed and can be added later when eveything else works K.
No.8 | | 1913 bytes |
| 
I do not want multithreading. I assume that each connection is a thread,
no? The images are broken, partially displayed, the image is displayed as
text characters.
Maybe this will help, here is my code so far:
procedure TForm1.HttpServer1GetDocument(Sender, Client: T;
var Flags: THttpGetFlag);
var
C: THttpConnection;
begin
C := THttpConnection(Client);
if C.Path = '/' then
begin
ShowDirectory(Sender, Client, Flags);
Exit;
end;
if FileExists(C.Document) and (Pos('image', C.Params)>0) then
begin
ShowShowimage(Sender, Client, Flags);
Exit;
end;
end;
procedure TForm1.ShowThumb(Sender, Client: T; Flags: THttpGetFlag);
var
i: Integer;
C: THttpConnection;
JPeg: TJPegImage;
ar: Double;
nx, ny: Integer;
ms: TMemoryStream;
begin
C := THttpConnection(Client);
Flags := hgSendStream;
ms := TMemoryStream.Create;
JPeg := TJPegImage.Create;
JPeg.LoadFromFile(C.Document);
if Jpeg.Width 100 then
begin
ar := 100 / JPeg.Width;
nx := Round(JPeg.Width * ar);
ny := Round(JPeg.Height * ar);
ResizeJPeg(JPeg, nx, ny);
end;
JPeg.SaveToStream(ms);
JPeg.Free;
C.DocStream := ms;
C.AnswerStream(Flags, '', 'image/jpeg', '');
end;
Message
From: "Francois Piette" <francois.piette (AT) overbyte (DOT) be>
To: "ICS support mailing" <twsocket (AT) elists (DOT) org>
Sent: Tuesday, August 16, 2005 9:43 AM
Subject: Re: [twsocket] Httpserver and threads
First make this work single threaded, starting with ICS sample program
WebServ.
Your image URL must match a dynamic URL intercepted by the server so that
processing can be done.
Multithreading is probably not needed and can be added later when
eveything else works K.
No.9 | | 352 bytes |
| 
I do not want multithreading.
I assume that each connection is a thread, no?
No ! ICS is asynchronous and event driven. It doesn't block when a user is being serviced.
The images are broken, partially displayed, the image is displayed as
text characters.
Are you using the latest ICS release downloaded from my website ?
No.10 | | 889 bytes |
| 
I just downloaded and installed the latest, which I was using to start with.
It still draws garbage, image as text, etc. Does my code look okay?
Thanks for your assistance, Francois.
Message
From: "Francois Piette" <francois.piette (AT) overbyte (DOT) be>
To: "ICS support mailing" <twsocket (AT) elists (DOT) org>
Sent: Tuesday, August 16, 2005 9:56 AM
Subject: Re: [twsocket] Httpserver and threads
>I do not want multithreading.
>I assume that each connection is a thread, no?
>
No ! ICS is asynchronous and event driven. It doesn't block when a user is
being serviced.
>
>The images are broken, partially displayed, the image is displayed as
>text characters.
>
Are you using the latest ICS release downloaded from my website ?
No.11 | | 247 bytes |
| 
Does my code look okay?
At first glance, yes. I haven't checked the jpeg stuff. You should save the
jpeg data into a file, just to check it is displayed ok. Maybe the garbage
you see is not in the sending but simply in the data !
No.12 | | 608 bytes |
| 
I can use Windows explorer and look at every image just fine.
Message
From: "Francois PIETTE" <francois.piette (AT) overbyte (DOT) be>
To: "ICS support mailing" <twsocket (AT) elists (DOT) org>
Sent: Tuesday, August 16, 2005 11:06 AM
Subject: Re: [twsocket] Httpserver and threads
>Does my code look okay?
>
At first glance, yes. I haven't checked the jpeg stuff. You should save
the
jpeg data into a file, just to check it is displayed ok. Maybe the garbage
you see is not in the sending but simply in the data !
No.13 | | 3620 bytes |
| 
I should also add that if I hit refresh, I get very odd results. Sometimes
I will get an image, text (jpeg image as text) or a blank page. Is this a
socket connection problem (i.e. reuse of socket)? Francois, keep in mind I
am by no means an expert to socket communication.
Thanks,
Tom
Message
From: "Tom York" <sales (AT) yorkinfo (DOT) com>
To: "ICS support mailing" <twsocket (AT) elists (DOT) org>
Sent: Tuesday, August 16, 2005 11:40 AM
Subject: Re: [twsocket] Httpserver and threads
>I can use Windows explorer and look at every image just fine.
>
Message
From: "Francois PIETTE" <francois.piette (AT) overbyte (DOT) be>
To: "ICS support mailing" <twsocket (AT) elists (DOT) org>
Sent: Tuesday, August 16, 2005 11:06 AM
Subject: Re: [twsocket] Httpserver and threads
--
Does my code look okay?
>>
>At first glance, yes. I haven't checked the jpeg stuff. You should save
>the
>jpeg data into a file, just to check it is displayed ok. Maybe the
>garbage
>you see is not in the sending but simply in the data !
>>
>--
>francois.piette (AT) overbyte (DOT) be
>http://www.overbyte.be
>>
>>
>>
>Message
>From: "Tom York" <sales (AT) yorkinfo (DOT) com>
>To: "ICS support mailing" <twsocket (AT) elists (DOT) org>
>Sent: Tuesday, August 16, 2005 5:15 PM
>Subject: Re: [twsocket] Httpserver and threads
>>
>>
I just downloaded and installed the latest, which I was using to start
with.
It still draws garbage, image as text, etc. Does my code look okay?
Thanks for your assistance, Francois.
Message
From: "Francois Piette" <francois.piette (AT) overbyte (DOT) be>
To: "ICS support mailing" <twsocket (AT) elists (DOT) org>
Sent: Tuesday, August 16, 2005 9:56 AM
Subject: Re: [twsocket] Httpserver and threads
I do not want multithreading.
I assume that each connection is a thread, no?
No ! ICS is asynchronous and event driven. It doesn't block when a user
is
being serviced.
The images are broken, partially displayed, the image is displayed as
text characters.
Are you using the latest ICS release downloaded from my website ?
--
francois.piette (AT) overbyte (DOT) be
http://www.overbyte.be
--
To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at http://www.overbyte.be
--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.10/73 - Release Date:
8/15/2005
--
To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at http://www.overbyte.be
>>
>--
>To unsubscribe or change your settings for TWSocket mailing list
>please goto
>Visit our website at http://www.overbyte.be
>>
>>
>>
>>
>--
>No virus found in this incoming message.
>Checked by AVG Anti-Virus.
>Version: 7.0.338 / Virus Database: 267.10.10/73 - Release Date: 8/15/2005
>>
>>
>
No.14 | | 144 bytes |
| 
>I can use Windows explorer and look at every image just fine.
I mean the small images you create on the fly, not the original images.
No.15 | | 308 bytes |
| 
The first thing to verify is that it works using WebServ sample program
provided with ICS. If it works, then the problem is in your code. If the
sample doesn't work, then you somewhat corrupted your ICS installation or
has something strange on your system that triggers a bug no one else found.
No.16 | | 288 bytes |
| 
Hello Tom,
I do not want multithreading. I assume that each connection is a thread,
no?
No it is not. ICS components are running in the thread they are created
in, also the sockets. This is because non blocking is used.
Rgds, Wilfried
http://www.mestdagh.biz
No.17 | | 1170 bytes |
| 
Hello Tom,
To try to debug you can make the document as short as possilbe (only
some minimum of text and only 1 small image). Also you can try to make
the connection trough SocketSpy, then you can see the data sent by the
server and eventually make diagnositics out of it. If you dont get wise
on it I can give it a shot to. Then you have to open a port and I can
check from here maybe to see what's wrong.
Rgds, Wilfried
http://www.mestdagh.biz
Tuesday, August 16, 2005, 16:36, Tom York wrote:
I am making a small server to display a page of images. In the getdocument
method, I call a procedure passing all of the flags to my procedure
"ShowThumb(Sender, Client, Flags)". What is happening is that the images
are being displayed on the page, but they are coming out as garbage
characters, randomly truncated images, etc.
The images stored on disk are good. I believe I am running into some kind
of threading issue. I read the images off disk, scale them, save the to a
stream and pass them to HttpConnection.DocStream to complete the page.
Any assistance is greatly appreciated. Thanks
No.18 | | 1671 bytes |
| 
Thank you Wilfried, I am going to play a bit more. If I am unable to figure
it out, then I think I will ask for more help.
Tom
Message
From: "Wilfried Mestdagh" <wilfried (AT) mestdagh (DOT) biz>
To: "ICS support mailing" <twsocket (AT) elists (DOT) org>
Sent: Tuesday, August 16, 2005 1:55 PM
Subject: Re: [twsocket] Httpserver and threads
Hello Tom,
To try to debug you can make the document as short as possilbe (only
some minimum of text and only 1 small image). Also you can try to make
the connection trough SocketSpy, then you can see the data sent by the
server and eventually make diagnositics out of it. If you dont get wise
on it I can give it a shot to. Then you have to open a port and I can
check from here maybe to see what's wrong.
Rgds, Wilfried
http://www.mestdagh.biz
Tuesday, August 16, 2005, 16:36, Tom York wrote:
>
>I am making a small server to display a page of images. In the
>getdocument
>method, I call a procedure passing all of the flags to my procedure
>"ShowThumb(Sender, Client, Flags)". What is happening is that the images
>are being displayed on the page, but they are coming out as garbage
>characters, randomly truncated images, etc.
>
>The images stored on disk are good. I believe I am running into some
>kind
>of threading issue. I read the images off disk, scale them, save the to
>a
>stream and pass them to HttpConnection.DocStream to complete the page.
>
>Any assistance is greatly appreciated. Thanks
>
>
No.19 | | 1700 bytes |
| 
Message
From: "Tom York" <sales (AT) yorkinfo (DOT) com>
To: "ICS support mailing" <twsocket (AT) elists (DOT) org>
Sent: Tuesday, August 16, 2005 3:48 PM
Subject: Re: [twsocket] Httpserver and threads
>I do not want multithreading. I assume that each connection is a thread,
no? The images are broken, partially displayed, the image is displayed as
text characters.
Maybe this will help, here is my code so far:
procedure TForm1.HttpServer1GetDocument(Sender, Client: T;
var Flags: THttpGetFlag);
var
C: THttpConnection;
begin
C := THttpConnection(Client);
if C.Path = '/' then
begin
ShowDirectory(Sender, Client, Flags);
Exit;
end;
if FileExists(C.Document) and (Pos('image', C.Params)>0) then
begin
ShowShowimage(Sender, Client, Flags);
Exit;
end;
end;
procedure TForm1.ShowThumb(Sender, Client: T; Flags: THttpGetFlag);
var
i: Integer;
C: THttpConnection;
JPeg: TJPegImage;
ar: Double;
nx, ny: Integer;
ms: TMemoryStream;
begin
C := THttpConnection(Client);
Flags := hgSendStream;
ms := TMemoryStream.Create;
JPeg := TJPegImage.Create;
JPeg.LoadFromFile(C.Document);
if Jpeg.Width 100 then
begin
ar := 100 / JPeg.Width;
nx := Round(JPeg.Width * ar);
ny := Round(JPeg.Height * ar);
ResizeJPeg(JPeg, nx, ny);
end;
JPeg.SaveToStream(ms);
JPeg.Free;
C.DocStream := ms;
Did you forget ms.position := 0;
I'm not sure if its needed or not.
C.AnswerStream(Flags, '', 'image/jpeg', '');
end;
Dan