Sends 'raw' MIME headers and data back to browser.
numero = 257[returnraw]HTTP/1.0 200 OKContent-type: text/html[unurl]%0D%0A%0D%0A[/unurl]<html>...your HTML here...</html>[/returnraw]
the above example must have several <Carriage Return><LineFeed> at the end of the line in order to work. On a PC, simply using NotePad to create the file will put CR/LF in the proper places. On a Macintosh you may use BBEdit or another text editor to set the file type to DOS-style line endings.
For illustration purposes, the example above shows the MIME headers automatically created for you whenever you display any normal page from WebDNA. Of course, since these headers are always created automatically, this example does nothing special -- the real usefulness of this feature comes when you change the MIME headers to do something special, like a URL-redirect.The following example causes the remote browser to immediately redirect to a different URL. This is better that the META tag some newer browsers support, because almost all browsers understand the low-level MIME header URL redirect.[returnraw]HTTP/1.0 302 FoundLocation: http://www.webdna.us/[unurl]%0D%0A%0D%0A[/unurl](some WebDNA here that does something interesting)[/returnraw]
[returnraw]HTTP/1.1 301 Moved PermanentlyLocation: http://www.webdna.us[unurl]%0D%0A%0D%0A[/unurl][/returnraw]
when you put a [returnraw] context into a template, any text outside the [ReturnRaw] container is ignored. So if you want to display some HTML after the raw MIME headers, you must put that HTML inside the context.
'BinaryBody' option:[returnraw binarybody=...]Allows the WebDNA programmer to designate a file (binary or text) to be attached as the 'body' of an HTTP response. This makes it possible to send a binary file (image, executable, etc...) back to the client. For example, you can 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 current folder, binary or text.<!--HAS_WEBDNA_TAGS--><HTML><BODY>[!]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 200 OK[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.[listfiles path=.][showif [isfile]=T]<a href=[thisurl]?getfile=[url][filename][/url]>[filename]</a><br>[/showif][/listfiles]</BODY></HTML>[returnraw]MIME Headers and Body content[/returnraw]
[returnraw]HTTP/1.0 200 OK
Content-type: text/html[unurl]%0D%0A%0D%0A[/unurl]
<html>
...your HTML here...
</html>[/returnraw]
the above example must have several <Carriage Return><LineFeed> at the end of the line in order to work. On a PC, simply using NotePad to create the file will put CR/LF in the proper places. On a Macintosh you may use BBEdit or another text editor to set the file type to DOS-style line endings.
[returnraw]HTTP/1.0 302 Found
Location: http://www.webdna.us/[unurl]%0D%0A%0D%0A[/unurl]
(some WebDNA here that does something interesting)
[/returnraw]
[returnraw]HTTP/1.1 301 Moved Permanently
Location: http://www.webdna.us[unurl]%0D%0A%0D%0A[/unurl][/returnraw]
when you put a [returnraw] context into a template, any text outside the [returnraw] container is ignored. So if you want to display some HTML after the raw MIME headers, you must put that HTML inside the context.
<!--HAS_WEBDNA_TAGS-->
<HTML>
<BODY>
[!]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 200 OK[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.
[listfiles path=.]
[showif [isfile]=T]
<a href=[thisurl]?getfile=[url][filename][/url]>[filename]</a><br>
[/showif]
[/listfiles]
</BODY>
</HTML>
DOWNLOAD WEBDNA NOW!
WebDNA applications...
AWS Raw WebDNA LAMP-Plus WebServerAmazon Web Services (AWS) README for Machine Image ID...
WebDNA ModulesA list of the currently available modules...
WebDNA LibrariesA list of available libraries for WebDNA...
[biotype]BioType is a behavioral biometrics WebDNA function based on ADGS research and development (from version 8...
Technical Change HistoryThis Technical Change History provides a reverse chronological list of WebDNA changes...
[shell] is a way to use the command line with your webserver...
[fileinfo]Displays information about a particular file or folder...
[writefile][writefile] functions allows you to perform a wide variety of tasks...
[ddesend]Sends text to a DDE server program on the local machine...
[ipaddress]Displays the ip address of the remote computer...
[SQLinfo]...