Re: TcpConnect get files on ver. 5.x FIXED FIXED FIXED

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 55631
interpreted = N
texte = Okay, for the 5.2 release, it is now again possible to fetch a binary file, via [writefile] wrapped around [TCPSend]. And the TCPSend code is still using the improved method of receiving large 'chunks' of data per socket read. Better yet, in combination with the 'skipheader' option for TCP send, the resulting file should be an exact copy of the source. Example: [tcpconnect host=[host]] [writefile file=test.jpg][tcpsend skipheader=T]GET /[path_to_jpg] HTTP/1.0[unurl]%0D%0A[/unurl][!] [/!]Host: [host][unurl]%0D%0A%0D%0A[/unurl][!] [/!][/tcpsend][/writefile] [/tcpconnect] -----Original Message----- From: Scott Anderson [mailto:Sanderson@smithmicro.com] Sent: Thursday, January 22, 2004 10:47 AM To: WebDNA-Talk@talk.smithmicro.com Subject: Re: TcpConnect get files on ver. 5.x BUG BUG BUG Well...let me backup a step... The TCPSend code was updated to receive larger chunks of data, over the open socket, per 'read', and appended to a new temp buffer. After receiving all the data, the temp stream is copied to the return buffer. The old method read the socket one character at a time and appended it directly to the return buffer (which in the case of a wrapping [writefile], appended the character directly to the output file). So I can see how this worked before. Question for Morten: Given your sample code: [!]---------- GET A FILE FROM A GIVEN DOMAIN AND PATH -----------[/!] [text]host=www.domain.com[/text] [text]path=/path_to_file_location/on_the_webserver[/text] [text]filename=filename.jpg[/text] [TCPConnect host=[host]] [writefile file=incoming/[filename]][TCPSend]GET [path]/[filename][unurl]%0D%0A[/unurl][/TCPSend][/writefile] [/TCPConnect] The resulting file (as Alain also pointed out), would contain the HTTP resonse headers. Would this not corrupt the image file? -----Original Message----- From: Scott Anderson [mailto:Sanderson@smithmicro.com] Sent: Thursday, January 22, 2004 9:45 AM To: WebDNA-Talk@talk.smithmicro.com Subject: Re: TcpConnect get files on ver. 5.x BUG BUG BUG Actually, taking a second look at these posts, I do not think you can use TCPConnect/TPSend to retrieve binary data. The internal buffers only handle ASCII data and will truncate after the first NULL character. Which is probably why you only get the gif header. It has always been like this. I do not see how this could have worked for any WebDNA version. -----Original Message----- From: Gary Krockover [mailto:gary@garykrockover.com] Sent: Thursday, January 22, 2004 9:01 AM To: WebDNA-Talk@talk.smithmicro.com Subject: Re: TcpConnect get files on ver. 5.x BUG BUG BUG I don't have 4.x installed here anywhere to test, but can confirm the same issue in 5.1e developer on Win2k. It does start to pull down a test image file, I see the gif89a header, but the file is incomplete. GK At 09:34 AM 1/22/2004, you wrote: >Ok - I have now tried every possible way of executing the code - And I can >only come the the conclusion that it must at bug in WebDNA version 5 - so >we can't convert to version 5.X before this is fixed. > >Is there a system for reporting bugs? o > >Regards >Morten ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: TcpConnect get files on ver. 5.x FIXED FIXED FIXED - ( "Scott Anderson" 2004)
  2. Re: TcpConnect get files on ver. 5.x FIXED FIXED FIXED ( Jesse Proudman 2004)
  3. Re: TcpConnect get files on ver. 5.x FIXED FIXED FIXED ( "Scott Anderson" 2004)
Okay, for the 5.2 release, it is now again possible to fetch a binary file, via [writefile] wrapped around [tcpsend]. And the TCPSend code is still using the improved method of receiving large 'chunks' of data per socket read. Better yet, in combination with the 'skipheader' option for TCP send, the resulting file should be an exact copy of the source. Example: [tcpconnect host=[host]] [writefile file=test.jpg][tcpsend skipheader=T]GET /[path_to_jpg] HTTP/1.0[unurl]%0D%0A[/unurl][!] [/!]Host: [host][unurl]%0D%0A%0D%0A[/unurl][!] [/!][/tcpsend][/writefile] [/tcpconnect] -----Original Message----- From: Scott Anderson [mailto:Sanderson@smithmicro.com] Sent: Thursday, January 22, 2004 10:47 AM To: WebDNA-Talk@talk.smithmicro.com Subject: Re: TcpConnect get files on ver. 5.x BUG BUG BUG Well...let me backup a step... The TCPSend code was updated to receive larger chunks of data, over the open socket, per 'read', and appended to a new temp buffer. After receiving all the data, the temp stream is copied to the return buffer. The old method read the socket one character at a time and appended it directly to the return buffer (which in the case of a wrapping [writefile], appended the character directly to the output file). So I can see how this worked before. Question for Morten: Given your sample code: [!]---------- GET A FILE FROM A GIVEN DOMAIN AND PATH -----------[/!] [text]host=www.domain.com[/text] [text]path=/path_to_file_location/on_the_webserver[/text] [text]filename=filename.jpg[/text] [TCPConnect host=[host]] [writefile file=incoming/[filename]][tcpsend]GET [path]/[filename][unurl]%0D%0A[/unurl][/TCPSend][/writefile] [/TCPConnect] The resulting file (as Alain also pointed out), would contain the HTTP resonse headers. Would this not corrupt the image file? -----Original Message----- From: Scott Anderson [mailto:Sanderson@smithmicro.com] Sent: Thursday, January 22, 2004 9:45 AM To: WebDNA-Talk@talk.smithmicro.com Subject: Re: TcpConnect get files on ver. 5.x BUG BUG BUG Actually, taking a second look at these posts, I do not think you can use TCPConnect/TPSend to retrieve binary data. The internal buffers only handle ASCII data and will truncate after the first NULL character. Which is probably why you only get the gif header. It has always been like this. I do not see how this could have worked for any WebDNA version. -----Original Message----- From: Gary Krockover [mailto:gary@garykrockover.com] Sent: Thursday, January 22, 2004 9:01 AM To: WebDNA-Talk@talk.smithmicro.com Subject: Re: TcpConnect get files on ver. 5.x BUG BUG BUG I don't have 4.x installed here anywhere to test, but can confirm the same issue in 5.1e developer on Win2k. It does start to pull down a test image file, I see the gif89a header, but the file is incomplete. GK At 09:34 AM 1/22/2004, you wrote: >Ok - I have now tried every possible way of executing the code - And I can >only come the the conclusion that it must at bug in WebDNA version 5 - so >we can't convert to version 5.X before this is fixed. > >Is there a system for reporting bugs? o > >Regards >Morten ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ "Scott Anderson"

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

.. more on sliding discounts... (1997) SHOWNEXT (1999) Suddenly can't see files... (2000) customizing the color of user's pages (1997) Dark Horse Comics success story (1997) Removing items from a cart is wonky... (1998) Encryption method used for [encrypt]? (2000) WC2.0 Memory Requirements (1997) 'does not contain' operator needed ... (1997) Image Pirating [protecting against] (2003) Search Engine bots (2002) CommandSecurity? (1997) Auto Archives, Gift Certs, and More.. (2003) Emailer error 571 (1998) [WebDNA] Bug in decrypt method=Base64 (2012) nested showif? (1998) When to use [convertchars] ?!?!? (2000) test (2000) ReturnRaw and redirect one last question (1997) PSC recommends what date format yr 2000??? (1997)