Gems problem

Ken Dow
Tue, 18 Sep 2001 07:16:43 -0400


>I am having a problem with Gems on my Manila Website. When clicking on Gems
>that have been uploaded - the browser displays a mixture of weird characters
>and text - sometimes no text, just the strange characters. The files
>uploaded are Word documents - but the browser doesn't seem to recognise them
>as work documents.

Are you serving the gems from Frontier on a Mac? If so, there's a 
reported problem in that Frontier doesn't correctly set file types on 
uploaded gems.

// Non-Newbie technical goo follows!

Webstar correctly interprets the type from the extension but Frontier 
does not, relying on the type. This is taken from 
user.webserver.prefs.type2MIME, which is very minimal and should be 
updated with a complete MIME type list.

I don't think there are any callbacks around gem uploads, but you 
could write an agent that would loop over your gems folders and set 
the type. You might also be able to write a lightWeightMacros 
callback that could overwrite the MIME type before serving - not sure 
about that....

In the spirit of Manila love (go Brent!), the fix is in 

	if system.environment.isWindows {
		objectType = string.replaceAll (objectType, " ", ""); 
// strip spaces
		try {mimeType = user.webserver.prefs.ext2MIME.[objectType]}};

	if system.environment.isMac {
		try {mimeType = user.webserver.prefs.type2MIME.[objectType]}}

If the second "if" statement checked for a missing file type and an 
extension and fell back on the method used for Windows, and if both 
of these MIME type tables fleshed out and synchronized, we'd be in 

Regards / Ken

Online Introduction to Manila Course: Oct 8, Nov 5, Dec 3

If you think education is expensive, try ignorance.
- Derek Bok