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:

Proper file locations (1997) Problem (1997) Generating Report Totals (1997) CSV import suggestions (2007) [WebDNA] WebDNA Shipping rate quotes API (2011) File Upload (1997) Document Contains No Data! (1997) Opinion: [input] should be called [output] ... (1997) emailer (1997) ShowNext (1997) Error Log.db --however (1997) Dr. Watson Error (1998) Re:2nd WebCatalog2 Feature Request (1996) Emailer setup (1997) Question about searching combination of fields (2003) WebMerchant & AuthorizeNet setup? (2000) [shell] command (2000) More Applescript (1997) Date search - yes or no (1997) Retaining formatting (2000)