Re: [WebDNA] ReturnRaw and binarybody

This WebDNA talk-list message is from

2013


It keeps the original formatting.
numero = 110519
interpreted = N
texte = --Apple-Mail=_CAE4111C-4885-48CD-ACEE-59D0D5316FB5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Tom Glad you got it worked out :) You could just do this .... [TEXT]MyImage=3D[ENCRYPT method=3Dbase64&file=3Dtest.jpg][/ENCRYPT][/TEXT]= [WRITEFILE file=3Dtest.inc][MyImage][/WRITEFILE] It also gives you the possibility of storing images in a db or a = preferences file. Regards Stuart Tremain IDFK Web Developments AUSTRALIA webdna@idfk.com.au On 24/07/2013, at 10:43 PM, Tom Duke wrote: > Stuart, >=20 > Hi - last post on this I promise. I just got there using a [shell] = script as you were suggesting. Final code is below, could be useful = for any situation where an image needs to be stored in a template. >=20 > - Tom >=20 >=20 >=20 > [!] > [/!][!] >=20 > ------------------------------------ > ### Do processing stuff here ### >=20 > [/!][!] >=20 > ------------------------------------ > ### Check for image and serve it out here ### >=20 > [/!][showif [fileinfo file=3Dblank.gif][exists][/fileinfo]=3DF][!] > = [/!][text]blank-gif-base64=3DR0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABA= AEAAAICRAEAOw=3D=3D[/text][!] > [/!][writefile file=3Dblank.gif][shell]echo [blank-gif-base64] | = base64 --decode[/shell][/writefile][!] > [/!][/showif][!] >=20 > [/!][text]crlf=3D[unurl]%0D%0A[/unurl][/text][!] >=20 > [/!][returnRaw binarybody=3Dblank.gif]HTTP/1.0 200 OK[crlf][!] >=20 > [/!]Status: 200[crlf][!] >=20 > [/!]Content-Type: image/gif[crlf][crlf][!] >=20 > [/!][/returnraw] >=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=_CAE4111C-4885-48CD-ACEE-59D0D5316FB5 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii Tom

Glad you got it worked out :)

You could just do this ....

[TEXT]MyImage=[ENCRYPT method=base64&file=test.jpg][/ENCRYPT][/TEXT]

[WRITEFILE file=test.inc][MyImage][/WRITEFILE]

<img src="data:image/jpg;base64,[INCLUDE file=test.inc]">

It also gives you the possibility of storing images in a db or a preferences file.

Regards

Stuart Tremain
IDFK Web Developments
AUSTRALIA




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

Stuart,

Hi - last post on this I promise.   I just got there using a [shell] script as you were suggesting.   Final code is below, could be useful for any situation where an image needs to be stored in a template.

- Tom



[!]<!-- HAS_WEBDNA_TAGS -->
[/!][!]

------------------------------------
###  Do processing stuff here  ###

[/!][!]

------------------------------------
###  Check for image and serve it out here  ###

[/!][showif [fileinfo file=blank.gif][exists][/fileinfo]=F][!]
[/!][text]blank-gif-base64=R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==[/text][!]
[/!][writefile file=blank.gif][shell]echo [blank-gif-base64] | base64 --decode[/shell][/writefile][!]
[/!][/showif][!]

[/!][text]crlf=[unurl]%0D%0A[/unurl][/text][!]

[/!][returnRaw binarybody=blank.gif]HTTP/1.0 200 OK[crlf][!]

[/!]Status: 200[crlf][!]

[/!]Content-Type: image/gif[crlf][crlf][!]

[/!][/returnraw]




--------------------------------------------------------- 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=_CAE4111C-4885-48CD-ACEE-59D0D5316FB5-- 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=_CAE4111C-4885-48CD-ACEE-59D0D5316FB5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Tom Glad you got it worked out :) You could just do this .... [text]MyImage=3D[ENCRYPT method=3Dbase64&file=3Dtest.jpg][/ENCRYPT][/TEXT]= [WRITEFILE file=3Dtest.inc][MyImage][/WRITEFILE] It also gives you the possibility of storing images in a db or a = preferences file. Regards Stuart Tremain IDFK Web Developments AUSTRALIA webdna@idfk.com.au On 24/07/2013, at 10:43 PM, Tom Duke wrote: > Stuart, >=20 > Hi - last post on this I promise. I just got there using a [shell] = script as you were suggesting. Final code is below, could be useful = for any situation where an image needs to be stored in a template. >=20 > - Tom >=20 >=20 >=20 > [!] > [/!][!] >=20 > ------------------------------------ > ### Do processing stuff here ### >=20 > [/!][!] >=20 > ------------------------------------ > ### Check for image and serve it out here ### >=20 > [/!][showif [fileinfo file=3Dblank.gif][exists][/fileinfo]=3DF][!] > = [/!][text]blank-gif-base64=3DR0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABA= AEAAAICRAEAOw=3D=3D[/text][!] > [/!][writefile file=3Dblank.gif][shell]echo [blank-gif-base64] | = base64 --decode[/shell][/writefile][!] > [/!][/showif][!] >=20 > [/!][text]crlf=3D[unurl]%0D%0A[/unurl][/text][!] >=20 > [/!][returnRaw binarybody=3Dblank.gif]HTTP/1.0 200 OK[crlf][!] >=20 > [/!]Status: 200[crlf][!] >=20 > [/!]Content-Type: image/gif[crlf][crlf][!] >=20 > [/!][/returnraw] >=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=_CAE4111C-4885-48CD-ACEE-59D0D5316FB5 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii Tom

Glad you got it worked out :)

You could just do this ....

[text]MyImage=[ENCRYPT method=base64&file=test.jpg][/ENCRYPT][/TEXT]

[WRITEFILE file=test.inc][MyImage][/WRITEFILE]

<img src="data:image/jpg;base64,[INCLUDE file=test.inc]">

It also gives you the possibility of storing images in a db or a preferences file.

Regards

Stuart Tremain
IDFK Web Developments
AUSTRALIA




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

Stuart,

Hi - last post on this I promise.   I just got there using a [shell] script as you were suggesting.   Final code is below, could be useful for any situation where an image needs to be stored in a template.

- Tom



[!]<!-- HAS_WEBDNA_TAGS -->
[/!][!]

------------------------------------
###  Do processing stuff here  ###

[/!][!]

------------------------------------
###  Check for image and serve it out here  ###

[/!][showif [fileinfo file=blank.gif][exists][/fileinfo]=F][!]
[/!][text]blank-gif-base64=R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==[/text][!]
[/!][writefile file=blank.gif][shell]echo [blank-gif-base64] | base64 --decode[/shell][/writefile][!]
[/!][/showif][!]

[/!][text]crlf=[unurl]%0D%0A[/unurl][/text][!]

[/!][returnRaw binarybody=blank.gif]HTTP/1.0 200 OK[crlf][!]

[/!]Status: 200[crlf][!]

[/!]Content-Type: image/gif[crlf][crlf][!]

[/!][/returnraw]




--------------------------------------------------------- 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=_CAE4111C-4885-48CD-ACEE-59D0D5316FB5-- 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:

showif and cart (1997) info (1997) [append] and SSL (1997) [WebDNA] WebDNA not running after 10.6.3 update (2010) How nuch ram??? (1997) how to determine the actual file format of an image file? (2002) Heads up: WebCatalog 4 drops MacTCP, 68K (2000) Running _every_ page through WebCat ? (1997) Running _every_ page through WebCat-error.html (1997) [WebDNA] Strange happenings (2012) F3 crashing server (1997) Restart of DBserver (1997) FYI-WebCat Mac or NT (1997) Protecting Images (2003) Hosting Service (1998) forming a SKU (1999) PCS Frames-Default page is solution! (1997) more on the Shipcost update problem (1997) Show shoppingcart after remove last item (1997) WebCat2 - Getting to the browser's username/password data (1997)