[Mono-list] HttpHandler for *.jpg

Martin Hinks mhinks at gmail.com
Mon Jun 20 03:58:46 EDT 2005


What part of the app is failing?

Is the handler for .jpg types being called but the querystring is blank?

Have you traced through the application? If you can find exactly what
is failing we can file BugZilla reports.

If the handler is working post some source and I'll take a look later.

To find out what's going on add "response.writeline" statements at
various points in your code - or try Mono Debugger - although I dont
know how advanced it is...

Martin

On 6/20/05, Marc DM <m at phronein.com> wrote:
> (*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>
> 
> ---------------------------------------------------------------
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> 


-- 
Martin Hinks


More information about the Mono-list mailing list