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 stillusing the improved method of receiving large 'chunks' of data per socketread. 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 AMTo: WebDNA-Talk@talk.smithmicro.comSubject: Re: TcpConnect get files on ver. 5.x BUG BUG BUGWell...let me backup a step...The TCPSend code was updated to receive larger chunks of data, over theopensocket, per 'read', and appended to a new temp buffer. After receivingallthe data, the temp stream is copied to the return buffer. The oldmethodread the socket one character at a time and appended it directly to thereturn buffer (which in the case of a wrapping [writefile], appended thecharacter directly to the output file). So I can see how this workedbefore.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 HTTPresonse headers. Would this not corrupt the image file?-----Original Message-----From: Scott Anderson [mailto:Sanderson@smithmicro.com]Sent: Thursday, January 22, 2004 9:45 AMTo: WebDNA-Talk@talk.smithmicro.comSubject: Re: TcpConnect get files on ver. 5.x BUG BUG BUGActually, taking a second look at these posts, I do not think you canuseTCPConnect/TPSend to retrieve binary data. The internal buffers onlyhandleASCII data and will truncate after the first NULL character. Which isprobably why you only get the gif header. It has always been like this.Ido 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 AMTo: WebDNA-Talk@talk.smithmicro.comSubject: Re: TcpConnect get files on ver. 5.x BUG BUG BUGI don't have 4.x installed here anywhere to test, but can confirm thesameissue in 5.1e developer on Win2k. It does start to pull down a testimagefile, I see the gif89a header, but the file is incomplete.GKAt 09:34 AM 1/22/2004, you wrote:>Ok - I have now tried every possible way of executing the code - And Ican>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 toWeb 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 toWeb 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 toWeb 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:
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 stillusing the improved method of receiving large 'chunks' of data per socketread. 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 AMTo: WebDNA-Talk@talk.smithmicro.comSubject: Re: TcpConnect get files on ver. 5.x BUG BUG BUGWell...let me backup a step...The TCPSend code was updated to receive larger chunks of data, over theopensocket, per 'read', and appended to a new temp buffer. After receivingallthe data, the temp stream is copied to the return buffer. The oldmethodread the socket one character at a time and appended it directly to thereturn buffer (which in the case of a wrapping [writefile], appended thecharacter directly to the output file). So I can see how this workedbefore.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 HTTPresonse headers. Would this not corrupt the image file?-----Original Message-----From: Scott Anderson [mailto:Sanderson@smithmicro.com]Sent: Thursday, January 22, 2004 9:45 AMTo: WebDNA-Talk@talk.smithmicro.comSubject: Re: TcpConnect get files on ver. 5.x BUG BUG BUGActually, taking a second look at these posts, I do not think you canuseTCPConnect/TPSend to retrieve binary data. The internal buffers onlyhandleASCII data and will truncate after the first NULL character. Which isprobably why you only get the gif header. It has always been like this.Ido 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 AMTo: WebDNA-Talk@talk.smithmicro.comSubject: Re: TcpConnect get files on ver. 5.x BUG BUG BUGI don't have 4.x installed here anywhere to test, but can confirm thesameissue in 5.1e developer on Win2k. It does start to pull down a testimagefile, I see the gif89a header, but the file is incomplete.GKAt 09:34 AM 1/22/2004, you wrote:>Ok - I have now tried every possible way of executing the code - And Ican>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 toWeb 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 toWeb 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 toWeb 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:
WebCat2b15MacPlugin - showing [math] (1997)
maybe even an easier plan to satisfy need for solid tech support? (2000)
emailer (1997)
Request Time Out (1997)
inconsistent webcat calculation? (1997)
[WebDNA] [BULK] WebDNA 6.2 or 7.x Hosting (might be) Needed (2011)
writing orders to a db (1997)
Announce: Bug fix talk list (1999)
multiple search commands (1997)
[url] (1997)
[SearchString] problem with [search] context (1997)
Intermitent problem using [referrer] (1997)
form crasehes server (1997)
Range in [showif] (2000)
Banner Ad (1998)
PCS Frames (1997)
nested context (1998)
Shareware Listserver (1998)
need help please (1997)
Problem with CC problem ? (1997)