guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Learning Guile web. Stuck on returning an image.


From: Martyn Smith
Subject: Learning Guile web. Stuck on returning an image.
Date: Sun, 25 May 2014 23:30:33 +0100

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="" />

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]