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:
.. 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)