[listfiles path=.][showif [isfile]=T][filename] [listfiles path=.][showif [isfile]=T][thisurl]?getfile=[url][filename][/url]>[filename] DOWNLOAD WEBDNA NOW! 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...
[/showif][/listfiles]-----Original Message-----From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf OfMorten MadsenSent: Tuesday, October 26, 2004 7:24 AMTo: WebDNA TalkSubject: Re: Include binary files in template/XML (SOLVED/Request newfeature)Hi. I found a solution for my problem (problem: read below).Instead of [include] i used [TcpConnect] to our own server (localhost) -used the GET command on the requsted file, encrypted til data withbase64 and saved it in a textvar.********************************* CODE EXAMPLE************************************************[text]host=yourhost.com[/text][text]filename=filename.jpg[/text][text]path=/path/to/file/[filename][/text][TCPConnect host=[host]&port=80][text]binary_encoded_data=[Encrypt method=base64][TCPSendskipheader=T]GET [path] HTTP/1.0[UnURL]%0D%0A[/UnURL]Host: [host][unurl]%0D%0A%0D%0A[/unurl][/TCPSend][/Encrypt][/text][/TCPConnect]Result Binary (base64 encoded) data here: [binary_encoded_data]********************************* /CODE EXAMPLE************************************************BUT it would be alot better/easier if one could get binary files withthe use of [include]. It would be like this [includefile=binaryfile.jpg&raw=T&binary=T]Hope Smith Micro will consider this feature in a future release....Kind RegardsMorten-----Original Message-----From: Morten Madsen Sent: 26. oktober 2004 13:35To: WebDNA TalkSubject: Include binary files in template/XMLHiI have a problem - I need to generate a XML-file with image-filesincluded in the XML tags. At first i did not think it would be any problem - my plan was to use[write file] with the XML tags and information from the database. And inthe image-tag I planned on using [include file=...&raw=t] and [encryptmethod=base64] - but sadly the include can't read the file - because thefile is a binary file - and not a text file.Example:[Encrypt method=base64][include file=image.jpg&raw=t][/Encrypt]I would like this to return the data-stream from from the file - base64encoded.Honestly I really don't know much about this subject - Have anybody madeWebcat read binary files? Is it posible at all?I found a way to do it using .NET:http://www.perfectxml.com/Answers.asp?ID=2But since our system uses Webcatalog - i would prefer making a solutioni webdna.Hope you guys can help me...Kind RegardsMorten Madsen-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
I don't believe that can be used. What i want is to get the data-contentof a given file to be stored in a text var in a DNA template. I don'twant the browser to prompt the file for download. I can't see thatBinaryBody gives me this posibility - am i missing something? Or did Inot state my problem clearly enough?Kind RegardsMorten-----Original Message-----From: Sal D'Anna [mailto:saldanna@yahoo.com]Sent: 27. oktober 2004 02:57To: WebDNA TalkSubject: Re: Include binary files in template/XML (SOLVED/Requestnewfeature)New for WebDNA 5.1" - 'BinaryBody' option: [ReturnRaw binarybody=...] Allows the WebDNA programmer to designate a file (binary or text) to beattached as the 'body' of an HTTP response. This makes it possible tosend abinary file (image, executable, etc...) back to the client. For example,youcan create download links for any type of file, and that would force the'save as' dialog to open on the client machine. Example code: Creates a download link for every file in the currentfolder,binary or text.[!]Initailize the getfile variable[/!][text secure=f]getfile=[/text][!]Check if filename was passed in[/!][showif [getfile]!][text]line_ending=%0D%0A[/text][!]Generate the response[/!][ReturnRaw binarybody=[getfile]]HTTP/1.0 200OK[unurl][line_ending][/unurl][!][/!]Status: 200[unurl][line_ending][/unurl][!][/!]Content-Type:application/octet-stream[unurl][line_ending][/unurl][!][/!]Content-Disposition: attachment;filename="[getfile]"[unurl][line_ending][line_ending][/unurl][!][/!][/ReturnRaw][/showif][!] Generate a list of download links for all files in local directory[/!]Click on a filename to download.
[/showif][/listfiles]-----Original Message-----From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf OfMorten MadsenSent: Tuesday, October 26, 2004 7:24 AMTo: WebDNA TalkSubject: Re: Include binary files in template/XML (SOLVED/Request newfeature)Hi. I found a solution for my problem (problem: read below).Instead of [include] i used [tcpconnect] to our own server (localhost) -used the GET command on the requsted file, encrypted til data withbase64 and saved it in a textvar.********************************* CODE EXAMPLE************************************************[text]host=yourhost.com[/text][text]filename=filename.jpg[/text][text]path=/path/to/file/[filename][/text][TCPConnect host=[host]&port=80][text]binary_encoded_data=[Encrypt method=base64][TCPSendskipheader=T]GET [path] HTTP/1.0[unurl]%0D%0A[/UnURL]Host: [host][unurl]%0D%0A%0D%0A[/unurl][/TCPSend][/Encrypt][/text][/TCPConnect]Result Binary (base64 encoded) data here: [binary_encoded_data]********************************* /CODE EXAMPLE************************************************BUT it would be alot better/easier if one could get binary files withthe use of [include]. It would be like this [includefile=binaryfile.jpg&raw=T&binary=T]Hope Smith Micro will consider this feature in a future release....Kind RegardsMorten-----Original Message-----From: Morten Madsen Sent: 26. oktober 2004 13:35To: WebDNA TalkSubject: Include binary files in template/XMLHiI have a problem - I need to generate a XML-file with image-filesincluded in the XML tags. At first i did not think it would be any problem - my plan was to use[write file] with the XML tags and information from the database. And inthe image-tag I planned on using [include file=...&raw=t] and [encryptmethod=base64] - but sadly the include can't read the file - because thefile is a binary file - and not a text file.Example:[Encrypt method=base64][include file=image.jpg&raw=t][/Encrypt]I would like this to return the data-stream from from the file - base64encoded.Honestly I really don't know much about this subject - Have anybody madeWebcat read binary files? Is it posible at all?I found a way to do it using .NET:http://www.perfectxml.com/Answers.asp?ID=2But since our system uses Webcatalog - i would prefer making a solutioni webdna.Hope you guys can help me...Kind RegardsMorten Madsen-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
Top Articles:
Talk List
Related Readings:
emailer (1997)
[SQL] & ODBC on Mac (2000)
WebMerchant? (1998)
Multiple prices (1997)
Question... (2002)
Sku numbers (1997)
Price Change (2000)
Mail Integration (1999)
What is WebDNA (1997)
Security stumper [mildly OT] (2004)
Correlating the record found with the fieldname (2000)
ShowIf variables (1997)
Tab Charactor (1997)
Problems with shopping cart (1997)
Nested tags count question (1997)
I give up!! (1997)
customizing the color of user's pages (1997)
WebCat2b12 forgets serial # (1997)
Summing fields (1997)
OFF-TOPIC: For Gary Krockover ... (2003)