unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Martyn Smith <martyn.developer@googlemail.com>
To: guile-user@gnu.org
Subject: Learning Guile web. Stuck on returning an image.
Date: Sun, 25 May 2014 23:30:33 +0100	[thread overview]
Message-ID: <CA+dhi3siRAX3bq737RK9nRZcqxKDnaoeKLGn-GiqBMNfzegZcg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1180 bytes --]

Hi guys,

I am attempting to create a website as part of a learning experience with
guile. The code is originally based from ideas in
https://www.gnu.org/software/guile/manual/html_node/Web-Examples.html. My
code has progressed since the "Web Examples" page to support a more MVC
style. So far, so good-ish. :-)

Getting to the point of the email -- I am a bit confused how I would return
a jpg image. For example: -
<img src="/load-image?id=1234" />

The "1234" tells me which file to load and return.

Being primarily a .NET developer, I am struggling to understand how to
achieve such goal in guile. I have tried things like (read-file
"/location/to/image.jpg" "r") but no luck. Also tried to understand
converting to bytes in the documentation but again... no luck. Always
getting a 500 error. Yes, I have included (content-type . (image/jpg)) etc.

Can anyone give me a heads up on how to do such thing? How would I open the
jpg file? How would it be returned?

I don't think its worth providing any code here. I think the Web-Examples
page is the best place to review code, and how I would return an image from
that current codebase, etc.

Thanks for any suggestions.

mart

[-- Attachment #2: Type: text/html, Size: 1585 bytes --]

             reply	other threads:[~2014-05-25 22:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-25 22:30 Martyn Smith [this message]
2014-05-26  0:22 ` Learning Guile web. Stuck on returning an image Nala Ginrut
2014-05-26  9:05 ` Neil Jerram
  -- strict thread matches above, loose matches on Subject: below --
2015-12-11 11:46 Martyn Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+dhi3siRAX3bq737RK9nRZcqxKDnaoeKLGn-GiqBMNfzegZcg@mail.gmail.com \
    --to=martyn.developer@googlemail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).