[Mono-list] HttpHandler for *.jpg

Marc DM m at phronein.com
Mon Jun 20 03:53:27 EDT 2005


(*falling asleep as I type this*)

I have a HttpHandler that works on .NET but not on Mono. I need some
help to sort it out.

It is a HttpHandler to allow me to use a url like :
   
    http://mysite/images/Beach12/DCS001.JPG?w=200
    to give me the image at the specified url, but proportionately
resized to 200px wide.

    http://mysite/images/Beach12/DCS001.JPG?thumb=1
    to give me the image at the specified url, resized to a pre-defined
thumbnail size

etc...

I have the HttpHandler, written in c#, it compiles on mono (had to
change Response.TransmitFile to Response.WriteFile); no errors.

It compiles on Windows. No Problem.

using Microsoft .NET Framework 1.1 when I access
http://mysite/images/Beach12/DCS001.JPG?thumb=1 from my browser, a
thumbnailed version of the photo is created in the cache directory (if
it doesn't already exist, within the site), and then returned to the
browser. It works.

on Apache/2.0.54 (Debian GNU/Linux) mod_mono/1.0.9
Everything else in the application works beautifully.  But a call to
http://mysite/images/Beach12/DCS001.JPG?thumb=1 returns the full size
image and the QueryString is seemingly ignored. 

My Apache config, mono webapp file,web.config are attached below.

Can someone clue me in? How can I tell what's happening here.
Thanks.

Marc DM
-----------------APACHE CONFIG---------------------
---------------------/etc/apache2/sites-available/mysite----------
NameVirtualHost *:80
<VirtualHost *:80>
        ServerName mysite
        ServerAdmin webmaster at mysite

        DocumentRoot /home/gary/www/mysite/www/
        AddHandler mono .aspx .ascx .jpg

        DirectoryIndex default.aspx index.aspx default.html index.html

        <Directory /home/gary/www/mysite/www/>
                Options FollowSymLinks MultiViews
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

---------------------/etc/apache2/ mods-available/mono.conf----------
  MonoUnixSocket /tmp/mod_mono_server
  MonoRunXSP true
  MonoApplicationsConfigDir /etc/apache2/mod-mono-applications
  MonoDebug true

-----------------web.config---------------------
  <system.web>
    ...
    ...
    <httpHandlers>
      <add verb="*" path="*.jpg"
type="Mynamespace.HttpHandlers.ImageHandler,HolmokImageHandler />
</httpHandlers>

---------------------------------------------------------------



More information about the Mono-list mailing list