From: Haris Bogdanovi� on
I have this piece of code:
-------------------------------------------------------------------------------------------------------------------------
(hunchentoot:start (make-instance 'hunchentoot:acceptor :port 5000))

(push (hunchentoot:create-prefix-dispatcher "/" 'start-page)
hunchentoot:*dispatch-table*)
(push (hunchentoot:create-folder-dispatcher-and-handler "pics/" "c:")
hunchentoot:*dispatch-table*)


(defun start-page ()
(cl-who:with-html-output-to-string (*standard-output* nil :indent t)
(:html
(:body
(:img :alt "alt" :src "pics/pic01.jpg")))))
--------------------------------------------------------------------------------------------------------------------------------
and when I go to http://localhost:5000 I don't see a picture, I see
alternative text "alt".
Why, where is the problem ?


From: szabolcs.szucs on
Is there any HTML returned? What your browser says about the page's
content?

Cheers,
Sz

On Jun 23, 10:07 pm, "Haris Bogdanoviæ" <fbogdano...(a)xnet.hr> wrote:
> I have this piece of code:
> -------------------------------------------------------------------------------------------------------------------------
> (hunchentoot:start (make-instance 'hunchentoot:acceptor :port 5000))
>
> (push (hunchentoot:create-prefix-dispatcher "/" 'start-page)
> hunchentoot:*dispatch-table*)
> (push (hunchentoot:create-folder-dispatcher-and-handler "pics/" "c:")
>       hunchentoot:*dispatch-table*)
>
> (defun start-page ()
>   (cl-who:with-html-output-to-string (*standard-output* nil :indent t)
>     (:html
>      (:body
>       (:img :alt "alt" :src "pics/pic01.jpg")))))
> --------------------------------------------------------------------------------------------------------------------------------
> and when I go tohttp://localhost:5000I don't see a picture, I see
> alternative text "alt".
> Why, where is the problem ?

From: Jorge Gajon on
On 2010-06-23, Haris Bogdanovi� <fbogdanovic(a)xnet.hr> wrote:
> I have this piece of code:
> ----------------------------------------------------------------------
> (hunchentoot:start (make-instance 'hunchentoot:acceptor :port 5000))
>
> (push (hunchentoot:create-prefix-dispatcher "/" 'start-page)
> hunchentoot:*dispatch-table*)
> (push (hunchentoot:create-folder-dispatcher-and-handler "pics/" "c:")
> hunchentoot:*dispatch-table*)
>
>
> (defun start-page ()
> (cl-who:with-html-output-to-string (*standard-output* nil :indent t)
> (:html
> (:body
> (:img :alt "alt" :src "pics/pic01.jpg")))))
> ---------------------------------------------------------------------
> and when I go to http://localhost:5000 I don't see a picture, I see
> alternative text "alt".
> Why, where is the problem ?
>
>

Hello Haris,

Try this:

(hunchentoot:create-folder-dispatcher-and-handler "pics/" "c:\\pics")

I'm not sure if the path in "C:\\pics" should use a backward slash, I
don't have a Windows machine here to test on.

The first parameter is the URL prefix that you want to use to serve
static files, while the second parameter is the location in your drive
where these files are stored.

For example if you you have these files:

C:\pics\pic01.jpg
C:\pics\foo\bar.jpg

You could set a folder dispatcher like this:

(create-folder-dispatcher-and-handler "my-awesome-pics/" "c:\\pics")

Then in your html you can access your files like this:

<img src="my-awesome-pics/pic01.jpg" />
<img src="my-awesome-pics/foo/bar.jpg" />



--
Jorge Gajon
Mexico City
http://gajon.org