I am successfully using ns_register_proc to catch and
dynamically serve html page requests.
I would also like to dynamically serve the script and
image files that are embedded in those same html files.
I've tried, for example:
ns_register_proc GET /Images/*.png serve_image
and
ns_register_proc GET /*.png serve_image
to catch requests for my .png files, but my procedure
serve_image does not get called.
What am I missing?
Thanks,
Greg Davidson
--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list, simply send an email to <list...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
One thing you might need to do is to use an exact proc name ::serve_image.
You should also put an ns_log statement in that proc so that you know it is
being called, or not, maybe print out the url:
ns_register_proc GET /*.png ::server_image png
proc ::server_image {type} {
ns_log Notice "serving image type $type with url [ns_conn url]"
...
}
tom jackson
You can do this by creating a 404 handler that checks if the requested
file could be got from the database. If it can, it writes it to the
pageroot and returns it. The next time someone requests it, AOLserver
will serve it straight from the file system.
If you upload a new version of the file to the database, that proc
should then simply delete the existing file from the pageroot.
Here's an example:
http://panoptic.com/wiki/aolserver/AOLserver_Cookbook#Fast_caching_of_generated_pages
Regards,
Bas.
thanks,
/s.