New Content Type, was Re: [Zope] VarImage, Problems with uploaded files.

Terry Hancock hancock at anansispaceworks.com
Wed Sep 17 20:00:43 EDT 2003


On Wednesday 17 September 2003 06:34 pm, Terry Hancock wrote:
> Yeah, Zope has:  It's in lib/python/OFS/Image.py, class "File".  My advice is
> "don't mess with it", it knows what it's doing.  VarImage now heeds this
> information and only attempts to process image/jpeg, image/gif,
> or image/png data.

As I typed this, I remembered that recently I tried to upload some
"Ogg Vorbis" files into my Zope instance, and -- not too surprisingly --
Zope did *not* know what to do with them.  Does anybody have
any advice on how (best) to alter Zope so that it would recognize
such files automatically?

I just looked into OFS, and I see the real decision seems to be made
in content_types.py (duh), and seems to rely heavily on filename
extensions.  Which is okay, since I use ".ogg" for these files.  What's
the smart way to fix this? Can I do it in my Zope instance or from
product code, or do I have to actually hack the Zope sources 
themselves for this kind of change?  (Looks like hacking _addtypes
in content_types.py might do the trick?).

Strategic advice appreciated.

Oh, and BTW, this is because I'm thinking about writing a Zope music-player
applet plugin, wrapping the GPL Java player you can find at
http://www.javazoom.net/applets/jlguiapplet/jlguiapplet.html
by "JavaZOOM". Yes, it even uses WinAMP compatible skins. 
Isn't that cool?  Don't you just want a drop-in Zope version, so
you can pop it into your pages with <dtml-var song_player>?
And have a Folder interface for the playlist, so you just upload
the tracks you want?  I know I do.  8-)

It requires the non-free Java, but it's still pretty cool. I want to use it
on my personal page. ;-)  Thinking of calling it "Zogger".  What do you
think?  (If somebody's already done one, please tell me -- I did a
search, but didn't find any).

Cheers,
Terry

--
Terry Hancock ( hancock at anansispaceworks.com )
Anansi Spaceworks  http://www.anansispaceworks.com



More information about the Zope mailing list