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:

Everyone: List Traffic (was [include ...] behavior) (1997) [WebDNA] Nginx (2010) Install Webcatalog under NT4.0 and Microsoft IIS 2.0 (1997) Exclude by date - multiple (1997) 2.0 Info (1997) Thanks ! (1997) Secure server question (1997) E-mailer error codes (1997) Trigger Problems (2000) Emailer help....! (1997) Signal Raised (1997) Maybe off topic but how to charge (1997) PCS Frames (1997) Show if time tags (1997) Menu to select product variations (1997) database freeze (1997) [WebDNA] Server version 8.6 ? (2018) why is authenticate screwing with me today (2002) Can you do this??? and other stuff (1997) where to put code (1998)