Re: [WebDNA] ReturnRaw and binarybody

This WebDNA talk-list message is from

2013


It keeps the original formatting.
numero = 110512
interpreted = N
texte = --Apple-Mail=_686AAC5E-B875-47B5-8E3C-3917E4E4A007 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Tom If you are using WINDOWS, i do remember a bug in the Windows 5.0 version = for this that was fixed in a later version. You want to stream the content, not declare it as an image otherwise the = browser will want to display it rather than download it. I used it once many years ago and found it to be very fiddly. [ReturnRaw binarybody=3D[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=3D"[getfile]"[unurl][line_ending][line_ending][/unurl][!] [/!][/ReturnRaw] Regards Stuart Tremain IDFK Web Developments AUSTRALIA webdna@idfk.com.au On 24/07/2013, at 5:38 PM, Tom Duke wrote: > Hi all, >=20 > I'm trying to store an image in binary (i.e. Base64 encoded) format = and then serve it out using [returnraw] - basically I want to avoid = having to place the image into a folder on the server, rather store it = in the actual template. >=20 > Can this be done? How does 'binarybody' work, i.e. can I pass Base64 = data to it somehow? >=20 > Code so far is: >=20 >=20 > [text]binaryFile=3D[decrypt = method=3DBase64]base_64_encode_of_image[/decrypt][/text] >=20 >=20 > [text]line_ending=3D%0D%0A[/text] >=20 > [returnRaw binarybody=3D[binaryFile]]HTTP/1.0 200 = OK[unurl][line_ending][/unurl][!] >=20 > [/!]Status: 200[unurl][line_ending][/unurl][!] >=20 > [/!]Content-Type: image/gif[unurl][line_ending][/unurl][!] >=20 > [/!][/returnraw] >=20 >=20 > Thanks > - Tom >=20 >=20 >=20 >=20 > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list . To = unsubscribe, E-mail to: archives: = http://mail.webdna.us/list/talk@webdna.us Bug Reporting: = support@webdna.us --Apple-Mail=_686AAC5E-B875-47B5-8E3C-3917E4E4A007 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii Tom

If you are using WINDOWS, i do remember a bug in the Windows 5.0 version for this that was fixed in a later version.

You want to stream the content, not declare it as an image otherwise the browser will want to display it rather than download it.

I used it once many years ago and found it to be very fiddly.

[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]

Regards

Stuart Tremain
IDFK Web Developments
AUSTRALIA




On 24/07/2013, at 5:38 PM, Tom Duke <tom@revolutionaries.ie> wrote:

Hi all,

I'm trying to store an image in binary (i.e. Base64 encoded) format and then serve it out using [returnraw] - basically I want to avoid having to place the image into a folder on the server, rather store it in the actual template.

Can this be done?   How does 'binarybody' work, i.e. can I pass Base64 data to it somehow?

Code so far is:


[text]binaryFile=[decrypt method=Base64]base_64_encode_of_image[/decrypt][/text]


[text]line_ending=%0D%0A[/text]

[returnRaw binarybody=[binaryFile]]HTTP/1.0 200 OK[unurl][line_ending][/unurl][!]

[/!]Status: 200[unurl][line_ending][/unurl][!]

[/!]Content-Type: image/gif[unurl][line_ending][/unurl][!]

[/!][/returnraw]


Thanks
- Tom




--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us

--Apple-Mail=_686AAC5E-B875-47B5-8E3C-3917E4E4A007-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] ReturnRaw and binarybody (WebDNA 2013)
  2. Re: [WebDNA] ReturnRaw and binarybody (Tom Duke 2013)
  3. Re: [WebDNA] ReturnRaw and binarybody (WebDNA 2013)
  4. Re: [WebDNA] ReturnRaw and binarybody (Tom Duke 2013)
  5. Re: [WebDNA] ReturnRaw and binarybody (WebDNA 2013)
  6. Re: [WebDNA] ReturnRaw and binarybody (WebDNA 2013)
  7. Re: [WebDNA] ReturnRaw and binarybody (Tom Duke 2013)
  8. Re: [WebDNA] ReturnRaw and binarybody (WebDNA 2013)
  9. [WebDNA] ReturnRaw and binarybody (Tom Duke 2013)
--Apple-Mail=_686AAC5E-B875-47B5-8E3C-3917E4E4A007 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Tom If you are using WINDOWS, i do remember a bug in the Windows 5.0 version = for this that was fixed in a later version. You want to stream the content, not declare it as an image otherwise the = browser will want to display it rather than download it. I used it once many years ago and found it to be very fiddly. [ReturnRaw binarybody=3D[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=3D"[getfile]"[unurl][line_ending][line_ending][/unurl][!] [/!][/ReturnRaw] Regards Stuart Tremain IDFK Web Developments AUSTRALIA webdna@idfk.com.au On 24/07/2013, at 5:38 PM, Tom Duke wrote: > Hi all, >=20 > I'm trying to store an image in binary (i.e. Base64 encoded) format = and then serve it out using [returnraw] - basically I want to avoid = having to place the image into a folder on the server, rather store it = in the actual template. >=20 > Can this be done? How does 'binarybody' work, i.e. can I pass Base64 = data to it somehow? >=20 > Code so far is: >=20 >=20 > [text]binaryFile=3D[decrypt = method=3DBase64]base_64_encode_of_image[/decrypt][/text] >=20 >=20 > [text]line_ending=3D%0D%0A[/text] >=20 > [returnRaw binarybody=3D[binaryFile]]HTTP/1.0 200 = OK[unurl][line_ending][/unurl][!] >=20 > [/!]Status: 200[unurl][line_ending][/unurl][!] >=20 > [/!]Content-Type: image/gif[unurl][line_ending][/unurl][!] >=20 > [/!][/returnraw] >=20 >=20 > Thanks > - Tom >=20 >=20 >=20 >=20 > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list . To = unsubscribe, E-mail to: archives: = http://mail.webdna.us/list/talk@webdna.us Bug Reporting: = support@webdna.us --Apple-Mail=_686AAC5E-B875-47B5-8E3C-3917E4E4A007 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii Tom

If you are using WINDOWS, i do remember a bug in the Windows 5.0 version for this that was fixed in a later version.

You want to stream the content, not declare it as an image otherwise the browser will want to display it rather than download it.

I used it once many years ago and found it to be very fiddly.

[ReturnRaw binarybody=[getfile]]HTTP/1.0 200 OK<a target="_parent" href="page.dna?numero=271">[unurl]</a>[line_ending][/unurl]<a target="_parent" href="page.dna?numero=250">[!]</a> [/!]Status: 200<a target="_parent" href="page.dna?numero=271">[unurl]</a>[line_ending][/unurl]<a target="_parent" href="page.dna?numero=250">[!]</a> [/!]Content-Type: application/octet-stream<a target="_parent" href="page.dna?numero=271">[unurl]</a>[line_ending][/unurl]<a target="_parent" href="page.dna?numero=250">[!]</a> [/!]Content-Disposition: attachment; filename="[getfile]"<a target="_parent" href="page.dna?numero=271">[unurl]</a>[line_ending][line_ending][/unurl]<a target="_parent" href="page.dna?numero=250">[!]</a> [/!][/ReturnRaw]

Regards

Stuart Tremain
IDFK Web Developments
AUSTRALIA




On 24/07/2013, at 5:38 PM, Tom Duke <tom@revolutionaries.ie> wrote:

Hi all,

I'm trying to store an image in binary (i.e. Base64 encoded) format and then serve it out using [returnraw] - basically I want to avoid having to place the image into a folder on the server, rather store it in the actual template.

Can this be done?   How does 'binarybody' work, i.e. can I pass Base64 data to it somehow?

Code so far is:


[text]binaryFile=[decrypt method=Base64]base_64_encode_of_image[/decrypt][/text]


[text]line_ending=%0D%0A[/text]

[returnRaw binarybody=[binaryFile]]HTTP/1.0 200 OK[unurl][line_ending][/unurl][!]

[/!]Status: 200[unurl][line_ending][/unurl][!]

[/!]Content-Type: image/gif[unurl][line_ending][/unurl][!]

[/!][/returnraw]


Thanks
- Tom




--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us

--Apple-Mail=_686AAC5E-B875-47B5-8E3C-3917E4E4A007-- WebDNA

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:

I'm tired of all this! (2000) syntax question, not in online refernce (1997) I've been thinking (2002) IE Cache Problems... (1999) different show next (1997) [WebDNA] Cloud hosting and local development (2019) Semi-OT: PanIP patent infringement case (2001) Help! (2000) Problem (1997) Emailer (WebCat2) (1997) UPDATE PROBLEM (1997) I'm new be kind (1997) Re:Emailer and encryption (1997) webcat (2000) Online reference (1997) Anyone using WebCat UNIX on a busy server yet? (1999) What is WebDNA (1997) Multiple cart additions (1997) {middle} and variables (2002) ShowNext Questions (2000)